Skip to content

Commit e898504

Browse files
committed
Updated VideoSourceSingle to get image size before camera info, in case camera info doesn't contain taylor model and we write a default set of parameters back
1 parent 28a48de commit e898504

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

launch/mcptam.launch

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@
2121
<param name="camera_pose_file" type="string" value="$(find mcptam)/poses/poses.dat" />
2222
-->
2323

24-
<!--
2524
<rosparam command="load" file="$(find mcptam)/masks/masks_1,2,3,4.yaml" />
2625
<param name="masks_dir" type="string" value="$(find mcptam)/masks" />
27-
-->
2826

2927
<param name="mm_init_point_mode" type="string" value="$(arg init_mode)" />
3028
<param name="mm_init_point_max_num" type="int" value="200" />

src/VideoSourceSingle.cc

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,19 @@ VideoSourceSingle::VideoSourceSingle(bool bGetPoseSeparately)
7272

7373
ROS_INFO("VideoSourceSingle: Set up all subscriptions");
7474

75+
// Acquire an image and get image size from it
76+
mbAcquiredImage = false;
77+
while(!mbAcquiredImage && ros::ok())
78+
{
79+
// Trigger ROS callbacks
80+
mCallbackQueue.callAvailable();
81+
}
82+
83+
ROS_INFO("VideoSourceSingle: Got first image, extracting size");
84+
mirSize = CVD::ImageRef(mCVPtr->image.cols,mCVPtr->image.rows);
85+
mirFullScaleSize = CVD::ImageRef(mirSize.x * mirBinning.x, mirSize.y * mirBinning.y);
86+
87+
// Acquire the calibration info
7588
mbAcquiredInfo = false;
7689
while(!mbAcquiredInfo && ros::ok())
7790
{
@@ -83,6 +96,7 @@ VideoSourceSingle::VideoSourceSingle(bool bGetPoseSeparately)
8396
mInfoSub.shutdown();
8497
ROS_INFO("VideoSourceSingle: Got calibration info");
8598

99+
// Acquire pose info
86100
if(mbGetPoseSeparately)
87101
{
88102
mbAcquiredPose = false;
@@ -95,19 +109,6 @@ VideoSourceSingle::VideoSourceSingle(bool bGetPoseSeparately)
95109
mPoseSub.shutdown();
96110
ROS_INFO("VideoSourceSingle: Got pose");
97111
}
98-
99-
mbAcquiredImage = false;
100-
while(!mbAcquiredImage && ros::ok())
101-
{
102-
// Trigger ROS callbacks
103-
mCallbackQueue.callAvailable();
104-
}
105-
106-
ROS_INFO("VideoSourceSingle: Got first image, extracting size");
107-
108-
mirSize = CVD::ImageRef(mCVPtr->image.cols,mCVPtr->image.rows);
109-
mirFullScaleSize = CVD::ImageRef(mirSize.x * mirBinning.x, mirSize.y * mirBinning.y);
110-
111112
}
112113

113114
VideoSourceSingle::~VideoSourceSingle()

0 commit comments

Comments
 (0)