feat: add ROS camera info api.

This commit is contained in:
TinyOh
2019-03-26 13:58:20 +08:00
parent de24292cca
commit d36a288336
15 changed files with 200 additions and 42 deletions

View File

@@ -352,10 +352,10 @@ void Synthetic::InitProcessors() {
RECTIFY_PROC_PERIOD);
rectify_processor = rectify_processor_imp;
points_processor = std::make_shared<PointsProcessor>(
rectify_processor_imp -> getCalibInfoPair(),
rectify_processor_imp -> getCameraROSMsgInfoPair(),
POINTS_PROC_PERIOD);
depth_processor = std::make_shared<DepthProcessor>(
rectify_processor_imp -> getCalibInfoPair(),
rectify_processor_imp -> getCameraROSMsgInfoPair(),
DEPTH_PROC_PERIOD);
root_processor->AddChild(rectify_processor);
@@ -566,4 +566,20 @@ void Synthetic::NotifyStreamData(
}
}
std::shared_ptr<struct CameraROSMsgInfoPair>
Synthetic::GetCameraROSMsgInfoPair() {
if (calib_model_ == CalibrationModel::PINHOLE) {
auto processor = getProcessorWithStream(Stream::LEFT_RECTIFIED);
auto proc = static_cast<RectifyProcessorOCV*>(&(*processor));
return proc->getCameraROSMsgInfoPair();
#ifdef WITH_CAM_MODELS
} else if (calib_model_ == CalibrationModel::KANNALA_BRANDT) {
auto processor = getProcessorWithStream(Stream::LEFT_RECTIFIED);
auto proc = static_cast<RectifyProcessor*>(&(*processor));
return proc->getCameraROSMsgInfoPair();
#endif
}
return {};
}
MYNTEYE_END_NAMESPACE