The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

t/slam: Enable some tracing

+14
+14
src/xrt/auxiliary/tracking/t_tracker_slam.cpp
··· 16 16 #include "util/u_misc.h" 17 17 #include "util/u_sink.h" 18 18 #include "util/u_var.h" 19 + #include "util/u_trace_marker.h" 19 20 #include "os/os_threading.h" 20 21 #include "math/m_api.h" 21 22 #include "math/m_filter_fifo.h" ··· 844 845 static void 845 846 predict_pose(TrackerSlam &t, timepoint_ns when_ns, struct xrt_space_relation *out_relation) 846 847 { 848 + XRT_TRACE_MARKER(); 849 + 847 850 bool valid_pred_type = t.pred_type >= SLAM_PRED_NONE && t.pred_type <= SLAM_PRED_SP_SO_IA_IL; 848 851 SLAM_DASSERT(valid_pred_type, "Invalid prediction type (%d)", t.pred_type); 849 852 ··· 901 904 static void 902 905 filter_pose(TrackerSlam &t, timepoint_ns when_ns, struct xrt_space_relation *out_relation) 903 906 { 907 + XRT_TRACE_MARKER(); 908 + 904 909 if (t.filter.use_moving_average_filter) { 905 910 if (out_relation->relation_flags & XRT_SPACE_RELATION_POSITION_VALID_BIT) { 906 911 xrt_vec3 pos = out_relation->pose.position; ··· 1131 1136 extern "C" void 1132 1137 t_slam_get_tracked_pose(struct xrt_tracked_slam *xts, timepoint_ns when_ns, struct xrt_space_relation *out_relation) 1133 1138 { 1139 + XRT_TRACE_MARKER(); 1140 + 1134 1141 auto &t = *container_of(xts, TrackerSlam, base); 1135 1142 1136 1143 //! @todo This should not be cached, the same timestamp can be requested at a ··· 1160 1167 extern "C" void 1161 1168 t_slam_gt_sink_push(struct xrt_pose_sink *sink, xrt_pose_sample *sample) 1162 1169 { 1170 + XRT_TRACE_MARKER(); 1171 + 1163 1172 auto &t = *container_of(sink, TrackerSlam, gt_sink); 1164 1173 1165 1174 if (t.gt.trajectory->empty()) { ··· 1175 1184 extern "C" void 1176 1185 t_slam_receive_imu(struct xrt_imu_sink *sink, struct xrt_imu_sample *s) 1177 1186 { 1187 + XRT_TRACE_MARKER(); 1188 + 1178 1189 auto &t = *container_of(sink, TrackerSlam, imu_sink); 1179 1190 1180 1191 timepoint_ns ts = s->timestamp_ns; ··· 1205 1216 static void 1206 1217 receive_frame(TrackerSlam &t, struct xrt_frame *frame, int cam_index) 1207 1218 { 1219 + XRT_TRACE_MARKER(); 1220 + 1208 1221 if (cam_index == 1) { 1209 1222 flush_poses(t); // Useful to flush SLAM poses when no openxr app is open 1210 1223 } ··· 1215 1228 SLAM_DASSERT_(frame->timestamp < INT64_MAX); 1216 1229 img_sample sample{(int64_t)frame->timestamp, img, cam_index}; 1217 1230 if (t.submit) { 1231 + XRT_TRACE_IDENT(slam_push); 1218 1232 t.slam->push_frame(sample); 1219 1233 } 1220 1234 SLAM_TRACE("cam%d frame t=%lu", cam_index, frame->timestamp);