Viam C++ SDK current
Loading...
Searching...
No Matches
world_state.hpp
1#pragma once
2
3#include <common/v1/common.pb.h>
4
5#include <viam/sdk/common/pose.hpp>
6#include <viam/sdk/spatialmath/geometry.hpp>
7
8namespace viam {
9namespace sdk {
10
11// TODO(RSDK-4553) Add documentation for these types
13 public:
15 std::vector<GeometryConfig> geometries;
16 std::string reference_frame;
17 common::v1::GeometriesInFrame to_proto() const;
18 static geometries_in_frame from_proto(const common::v1::GeometriesInFrame& proto);
19 };
20
21 struct transform {
22 std::string reference_frame;
23 pose_in_frame pose_in_observer_frame;
24 std::shared_ptr<GeometryConfig> physical_object;
25
26 common::v1::Transform to_proto() const;
27 static transform from_proto(const common::v1::Transform& proto);
28 transform() {}
29 };
30
31 common::v1::WorldState to_proto() const;
32 static WorldState from_proto(const common::v1::WorldState& ws);
33
34 WorldState() {}
35 WorldState(std::vector<geometries_in_frame> obstacles, std::vector<transform> transforms)
36 : obstacles_(std::move(obstacles)), transforms_(std::move(transforms)) {}
37
38 friend bool operator==(const WorldState& lhs, const WorldState& rhs);
39 friend bool operator==(const geometries_in_frame& lhs, const geometries_in_frame& rhs);
40 friend bool operator==(const transform& lhs, const transform& rhs);
41
42 private:
43 std::vector<geometries_in_frame> obstacles_;
44 std::vector<transform> transforms_;
45};
46
47} // namespace sdk
48} // namespace viam
Definition world_state.hpp:12
Definition world_state.hpp:14
Definition world_state.hpp:21
Definition pose.hpp:30