Viam C++ SDK current
Loading...
Searching...
No Matches
pose_tracker.hpp
Go to the documentation of this file.
1
4#pragma once
5
6#include <string>
7#include <unordered_map>
8#include <vector>
9
10#include <viam/sdk/common/pose.hpp>
11#include <viam/sdk/components/component.hpp>
12#include <viam/sdk/spatialmath/geometry.hpp>
13
14namespace viam {
15namespace sdk {
16
18
24class PoseTracker : public Component {
25 public:
26 using pose_map = std::unordered_map<std::string, pose_in_frame>;
27
28 API api() const override;
29
35 inline pose_map get_poses(const std::vector<std::string>& body_names) {
36 return get_poses(body_names, {});
37 }
38
45 virtual pose_map get_poses(const std::vector<std::string>& body_names,
46 const ProtoStruct& extra) = 0;
47
51 virtual ProtoStruct do_command(const ProtoStruct& command) = 0;
52
54 inline std::vector<GeometryConfig> get_geometries() {
55 return get_geometries({});
56 }
57
60 virtual std::vector<GeometryConfig> get_geometries(const ProtoStruct& extra) = 0;
61
62 protected:
63 using Component::Component;
64};
65
66template <>
68 static API api();
69};
70
71} // namespace sdk
72} // namespace viam
Extends APIType to additionally define a resource's subtype (e.g., camera).
Definition resource_api.hpp:33
Definition component.hpp:10
A PoseTracker represents a physical pose or motion tracking device.
Definition pose_tracker.hpp:24
virtual pose_map get_poses(const std::vector< std::string > &body_names, const ProtoStruct &extra)=0
Get the poses of each body tracked by the pose tracker.
virtual ProtoStruct do_command(const ProtoStruct &command)=0
Send/receive arbitrary commands to the resource.
API api() const override
Returns the API associated with a particular resource.
virtual std::vector< GeometryConfig > get_geometries(const ProtoStruct &extra)=0
Returns GeometryConfigs associated with the calling pose tracker.
std::vector< GeometryConfig > get_geometries()
Returns GeometryConfigs associated with the calling pose tracker.
Definition pose_tracker.hpp:54
pose_map get_poses(const std::vector< std::string > &body_names)
Get the poses of each body tracked by the pose tracker.
Definition pose_tracker.hpp:35
Definition resource_api.hpp:50