scene/tables/sensors.h
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | // SPDX-License-Identifier: BSD-3-Clause | ||
| 2 | #pragma once | ||
| 3 | |||
| 4 | #include <cstdint> | ||
| 5 | #include <span> | ||
| 6 | #include <string_view> | ||
| 7 | #include <vector> | ||
| 8 | |||
| 9 | #include "chrono_batch_render/device/program.h" | ||
| 10 | #include "chrono_batch_render/device/ref.h" | ||
| 11 | #include "chrono_batch_render/scene/records/sensors.h" | ||
| 12 | #include "chrono_batch_render/scene/tables/storage.h" | ||
| 13 | #include "chrono_batch_render/scene/tables/table.h" | ||
| 14 | #include "chrono_batch_render/stage/structure/structure.h" | ||
| 15 | |||
| 16 | namespace chrono::batch_render { | ||
| 17 | |||
| 18 | class SensorTable : public RenderTable { | ||
| 19 | public: | ||
| 20 | 2118 | explicit SensorTable(Structure& structure) : m_structure(structure) {} | |
| 21 | |||
| 22 | 928 | std::string_view Name() const override { | |
| 23 | 928 | return "sensors"; | |
| 24 | } | ||
| 25 | |||
| 26 | std::span<const ColumnRef> Inputs() const override; | ||
| 27 | |||
| 28 | 353 | std::span<const TableId> TableOutputs() const override { | |
| 29 | 353 | static constexpr TableId kTables[] = {TableId::Cameras}; | |
| 30 | 353 | return kTables; | |
| 31 | } | ||
| 32 | |||
| 33 | void Prepare() override; | ||
| 34 | void Run(const ChangeSet& changes, TableVersions& versions) override; | ||
| 35 | void Describe(RenderTables& tables) const override; | ||
| 36 | |||
| 37 | 928 | void Hold(std::vector<Ref<const RefCounted>>& held) const override { | |
| 38 | 5568 | HoldBuffers(held, {m_cameras.Buffer(), m_distortions.Buffer(), m_detectors.Buffer(), | |
| 39 | m_lidars.Buffer(), m_radars.Buffer()}); | ||
| 40 | 1856 | } | |
| 41 | |||
| 42 | private: | ||
| 43 | device::Program& Kernels(); | ||
| 44 | |||
| 45 | Structure& m_structure; | ||
| 46 | Ref<device::Program> m_program; | ||
| 47 | DeviceTable<CameraRecord> m_cameras{"camera records"}; | ||
| 48 | DeviceTable<DistortionRecord> m_distortions{"distortion records"}; | ||
| 49 | DeviceTable<DetectorRecord> m_detectors{"detector records"}; | ||
| 50 | DeviceTable<LidarRecord> m_lidars{"lidar records"}; | ||
| 51 | DeviceTable<RadarRecord> m_radars{"radar records"}; | ||
| 52 | }; | ||
| 53 | |||
| 54 | } | ||
| 55 |