t/slam: Miscelaneous NFC changes

- Use @todo instead of TODO for doxygen
- Improve the slam_tracker interface documentation
- Move euroc functions declared by macros into extern C
This commit is contained in:
Mateo de Mayo 2021-09-17 09:30:39 -03:00 committed by Jakob Bornecrantz
parent 1a5af03111
commit debdb11e02
4 changed files with 15 additions and 10 deletions

View file

@ -89,8 +89,14 @@ struct slam_tracker {
void stop();
bool is_running();
//! Should be thread safe, more than one producer could push.
void push_imu_sample(imu_sample sample);
//! Should be thread safe, more than one producer could push.
void push_frame(img_sample sample);
//! Only one user will dequeue, thread safety not required.
//! Could be implemented with a lock-free queue.
bool try_dequeue_pose(pose &pose);
private:

View file

@ -56,8 +56,8 @@ using cv::UMatUsageFlags;
#warning "Kimera-VIO uses OpenCV 3.3.1, use that to prevent conflicts"
#endif
// TODO: These defs should make OpenCV 4 work but it wasn't tested against a
// SLAM system that supports that version yet
//! @todo These defs should make OpenCV 4 work but it wasn't tested against a
//! SLAM system that supports that version yet.
#if CV_VERSION_MAJOR < 4
#define ACCESS_RW 0
typedef int AccessFlag;
@ -174,8 +174,8 @@ extern "C" void
t_slam_imu_sink_push(struct xrt_imu_sink *sink, struct xrt_imu_sample *s)
{
auto &t = *container_of(sink, TrackerSlam, imu_sink);
// TODO: There are many conversions like these between xrt and
// slam_tracker.hpp types. Implement a casting mechanism to avoid copies.
//! @todo There are many conversions like these between xrt and
//! slam_tracker.hpp types. Implement a casting mechanism to avoid copies.
imu_sample sample{s->timestamp, s->ax, s->ay, s->az, s->wx, s->wy, s->wz};
t.slam->push_imu_sample(sample);
SLAM_TRACE("imu t=%ld a=[%f,%f,%f] w=[%f,%f,%f]", s->timestamp, s->ax, s->ay, s->az, s->wx, s->wy, s->wz);

View file

@ -28,9 +28,6 @@
} while (false);
#define EUROC_ASSERT_(predicate) EUROC_ASSERT(predicate, "Assertion failed " #predicate)
DEBUG_GET_ONCE_LOG_OPTION(euroc_log, "EUROC_LOG", U_LOGGING_WARN)
DEBUG_GET_ONCE_OPTION(euroc_path, "EUROC_PATH", NULL)
#ifdef __cplusplus
extern "C" {
#endif
@ -40,6 +37,9 @@ extern "C" {
* @{
*/
DEBUG_GET_ONCE_LOG_OPTION(euroc_log, "EUROC_LOG", U_LOGGING_WARN)
DEBUG_GET_ONCE_OPTION(euroc_path, "EUROC_PATH", NULL)
/*!
* @}
*/

View file

@ -320,8 +320,8 @@ euroc_player_load_next_frame(struct euroc_player *ep, bool is_left, struct xrt_f
// Create xrt_frame, it will be freed by FrameMat destructor
EUROC_ASSERT(xf == NULL || xf->reference.count > 0, "Must be given a valid or NULL frame ptr");
EUROC_ASSERT(timestamp > 0, "Unexpected negative timestamp");
// TODO: Not using xrt_stereo_format because we use two sinks. It would be
// better to refactor everything to use stereo frames instead.
//! @todo Not using xrt_stereo_format because we use two sinks. It would
//! probably be better to refactor everything to use stereo frames instead.
FrameMat::Params params{XRT_STEREO_FORMAT_NONE, static_cast<uint64_t>(timestamp)};
auto wrap = img.channels() == 3 ? FrameMat::wrapR8G8B8 : FrameMat::wrapL8;
wrap(img, &xf, params);
@ -537,7 +537,6 @@ euroc_player_stream_start(struct xrt_fs *xfs,
EUROC_INFO(ep, "Starting Euroc Player in calibration mode, will stream only left frames right away");
ep->out_sinks.left = xs;
euroc_player_start_btn_cb(ep);
ep->is_running = true;
} else {
EUROC_ASSERT(false, "Unsupported stream configuration xs=%p capture_type=%d", (void *)xs, capture_type);
return false;