supereight
Loading...
Searching...
No Matches
tracker.hpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2014 University of Edinburgh, Imperial College, University of Manchester
3 * SPDX-FileCopyrightText: 2016-2019 Emanuele Vespa
4 * SPDX-FileCopyrightText: 2022 Smart Robotics Lab, Imperial College London, Technical University of Munich
5 * SPDX-FileCopyrightText: 2022 Nils Funk
6 * SPDX-FileCopyrightText: 2022 Sotiris Papatheodorou
7 * SPDX-License-Identifier: MIT
8 */
9
10#ifndef SE_TRACKER_HPP
11#define SE_TRACKER_HPP
12
14#include <se/map/raycaster.hpp>
15#include <se/sensor/sensor.hpp>
16#include <se/tracker/icp.hpp>
17
18namespace se {
19
20constexpr float e_delta = 0.1f;
21
23 std::vector<int> iterations{10, 5, 4};
24 float dist_threshold = 0.1f;
25 float normal_threshold = 0.8f;
26 float track_threshold = 0.15f;
27 float icp_threshold = 0.00001f;
28
32 void readYaml(const std::string& filename);
33};
34
35std::ostream& operator<<(std::ostream& os, const TrackerConfig& c);
36
37
38
39template<typename MapT, typename SensorT>
40class Tracker {
41 public:
42 Tracker(MapT& map, const SensorT& sensor, const TrackerConfig config = TrackerConfig()) :
43 map_(map),
44 sensor_(sensor),
45 config_(config),
46 tracking_result(sensor_.model.imageWidth() * sensor_.model.imageHeight(), icp::Data())
47 {
48 }
49
58 bool track(const Image<float>& depth_img, Eigen::Isometry3f& T_WS);
59
71 Eigen::Isometry3f& T_WS,
74
76
77 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
78
79 private:
80 MapT& map_;
81 const SensorT& sensor_;
82 const TrackerConfig config_;
83 std::vector<icp::Data> tracking_result;
84};
85
86} // namespace se
87
88#include "impl/tracker_impl.hpp"
89
90#endif // SE_TRACKER_HPP
Definition image.hpp:19
Definition tracker.hpp:40
bool track(const Image< float > &depth_img, Eigen::Isometry3f &T_WS)
Track the current pose using ICP.
void renderTrackingResult(RGBA *tracking_img_data)
bool track(const Image< float > &depth_img, Eigen::Isometry3f &T_WS, Image< Eigen::Vector3f > &surface_point_cloud_W, Image< Eigen::Vector3f > &surface_normals_W)
Track the current pose using ICP.
Tracker(MapT &map, const SensorT &sensor, const TrackerConfig config=TrackerConfig())
Definition tracker.hpp:42
Helper wrapper to allocate and de-allocate octants in the octree.
Definition bounded_vector.hpp:14
constexpr float e_delta
Definition tracker.hpp:20
std::ostream & operator<<(std::ostream &os, const ColourData< Colour::Off >::Config &c)
Definition data.hpp:19
A colour represented as a Red-Green-Blue-Alpha tuple with 8-bits per channel.
Definition rgba.hpp:15
Definition tracker.hpp:22
void readYaml(const std::string &filename)
Reads the struct members from the "tracker" node of a YAML file.
float icp_threshold
Definition tracker.hpp:27
float dist_threshold
Definition tracker.hpp:24
float normal_threshold
Definition tracker.hpp:25
float track_threshold
Definition tracker.hpp:26
std::vector< int > iterations
Definition tracker.hpp:23