10 #ifndef SE_TRACKER_HPP 11 #define SE_TRACKER_HPP 31 void readYaml(
const std::string& filename);
43 TrackData() : result(0), error(0.0f), J{0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}
50 static inline Eigen::Matrix<float, 6, 6>
makeJTJ(
const Eigen::Matrix<float, 1, 21>& v)
52 Eigen::Matrix<float, 6, 6> C = Eigen::Matrix<float, 6, 6>::Zero();
53 C.row(0) = v.segment(0, 6);
54 C.row(1).segment(1, 5) = v.segment(6, 5);
55 C.row(2).segment(2, 4) = v.segment(11, 4);
56 C.row(3).segment(3, 3) = v.segment(15, 3);
57 C.row(4).segment(4, 2) = v.segment(18, 2);
60 for (
int r = 1; r < 6; ++r)
61 for (
int c = 0; c < r; ++c)
68 static inline Eigen::Matrix<float, 6, 1>
solve(
const Eigen::Matrix<float, 1, 27>& vals)
70 const Eigen::Matrix<float, 6, 1> b = vals.segment(0, 6);
71 const Eigen::Matrix<float, 6, 6> C =
makeJTJ(vals.segment(6, 21));
72 Eigen::LLT<Eigen::Matrix<float, 6, 6>> llt;
74 Eigen::Matrix<float, 6, 1> res = llt.solve(b);
75 return llt.info() == Eigen::Success ? res : Eigen::Matrix<float, 6, 1>::Zero();
80 template<
typename MapT,
typename SensorT>
87 tracking_result(sensor_.model.imageWidth() * sensor_.model.imageHeight(),
TrackData())
112 Eigen::Matrix4f& T_WS,
116 void renderTrackingResult(uint32_t* tracking_img_data);
119 void newReduce(
const int block_idx,
121 const Eigen::Vector2i& output_res,
123 const Eigen::Vector2i& J_res);
125 void reduceKernel(
float* output_data,
126 const Eigen::Vector2i& output_res,
128 const Eigen::Vector2i& J_res);
135 const Eigen::Matrix4f& T_WS,
136 const Eigen::Matrix4f& T_WS_ref,
140 bool updatePoseKernel(Eigen::Matrix4f& T_WS,
141 const float* reduction_output_data,
144 bool checkPoseKernel(Eigen::Matrix4f& T_WS,
145 Eigen::Matrix4f& previous_T_WS,
146 const float* reduction_output_data,
147 const Eigen::Vector2i& reduction_output_res,
151 const SensorT& sensor_;
153 std::vector<TrackData> tracking_result;
158 #include "impl/tracker_impl.hpp" 160 #endif // SE_TRACKER_HPP Definition: tracker.hpp:21
float normal_threshold
Definition: tracker.hpp:24
std::ostream & operator<<(std::ostream &os, const FieldDataConfig< se::Field::Occupancy > &c)
float error
Definition: tracker.hpp:40
static Eigen::Matrix< float, 6, 6 > makeJTJ(const Eigen::Matrix< float, 1, 21 > &v)
Definition: tracker.hpp:50
Definition: tracker.hpp:38
Tracker(MapT &map, const SensorT &sensor, const TrackerConfig config=TrackerConfig())
Definition: tracker.hpp:83
Definition: tracker.hpp:81
TrackData()
Definition: tracker.hpp:43
static Eigen::Matrix< float, 6, 1 > solve(const Eigen::Matrix< float, 1, 27 > &vals)
Definition: tracker.hpp:68
float icp_threshold
Definition: tracker.hpp:26
constexpr float e_delta
Definition: tracker.hpp:19
float dist_threshold
Definition: tracker.hpp:23
int result
Definition: tracker.hpp:39
void readYaml(const std::string &filename)
Reads the struct members from the "tracker" node of a YAML file.
float track_threshold
Definition: tracker.hpp:25
std::vector< int > iterations
Definition: tracker.hpp:22
Helper wrapper to allocate and de-allocate octants in the octree.
Definition: colour_utils.hpp:17