CARLA
 
载入中...
搜索中...
未找到
secondaryCommands.cpp
浏览该文件的文档.
1// Copyright (c) 2022 Computer Vision Center (CVC) at the Universitat Autonoma
2// de Barcelona (UAB).
3//
4// This work is licensed under the terms of the MIT license.
5// For a copy, see <https://opensource.org/licenses/MIT>.
6
7// #include "carla/Logging.h"
9// #include "carla/streaming/detail/tcp/Message.h"
10
11namespace carla {
12namespace multigpu {
13
14void SecondaryCommands::set_secondary(std::shared_ptr<Secondary> secondary) {
15 _secondary = secondary;
16}
17
19 _callback = callback;
20}
21
23 // get the header
24 CommandHeader *header;
25 header = reinterpret_cast<CommandHeader *>(buffer.data());
26
27 // send only data to the callback
28 Buffer data(buffer.data() + sizeof(CommandHeader), header->size);
29 _callback(header->id, std::move(data));
30
31 // log_info("Secondary got a command to process");
32}
33
34
35} // namespace multigpu
36} // namespace carla
A piece of raw data.
const value_type * data() const noexcept
Direct access to the allocated memory or nullptr if no memory is allocated.
std::function< void(MultiGPUCommand, carla::Buffer)> callback_type
void set_secondary(std::shared_ptr< Secondary > secondary)
std::shared_ptr< Secondary > _secondary
void set_callback(callback_type callback)
This file contains definitions of common data structures used in traffic manager.
Definition Carla.cpp:133