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
55 virtual ProtoStruct get_status() = 0;
56
58 inline std::vector<GeometryConfig> get_geometries() {
59 return get_geometries({});
60 }
61
64 virtual std::vector<GeometryConfig> get_geometries(const ProtoStruct& extra) = 0;
65
66 protected:
67 using Component::Component;
68};
69
70template <>
72 static API api();
73};
74
75} // namespace sdk
76} // namespace viam
Definition resource_api.hpp:21
Definition component.hpp:10
A PoseTracker represents a physical pose or motion tracking device.
Definition pose_tracker.hpp:24
virtual ProtoStruct get_status()=0
Get the status of the pose tracker.
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:58
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:46