Skip to content

Commit

Permalink
Setting sweep intermediate cloud optimizer camera parameters from sweep
Browse files Browse the repository at this point in the history
  • Loading branch information
RaresAmbrus committed Apr 13, 2016
1 parent ded4fa1 commit 00327df
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion calibrate_sweeps/src/calibrate_sweep_action_server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,19 @@ void execute(const calibrate_sweeps::CalibrateSweepsGoalConstPtr& goal, Server*
unsigned int gy = 3;
unsigned int todoy = 3;
RobotContainer * rc = new RobotContainer(gx,todox,gy,todoy);
rc->initializeCamera(540.0, 540.0,319.5, 219.5, 640, 480);

// initialize camera parameters from the sweep
if (matchingObservations.size()){
SemanticRoom<PointType> aRoom = SemanticRoomXMLParser<PointType>::loadRoomFromXML(matchingObservations[0],true);
if (aRoom.getIntermediateCloudCameraParameters().size()){
image_geometry::PinholeCameraModel aCameraModel = aRoom.getIntermediateCloudCameraParameters()[0];
rc->initializeCamera(aCameraModel.fx(), aCameraModel.fy(), aCameraModel.cx(), aCameraModel.cy(), aCameraModel.fullResolution().width, aCameraModel.fullResolution().height);
} else {
// no camera parameters saved with the sweep -> initialize optimizer with default parameters
rc->initializeCamera(540.0, 540.0,319.5, 219.5, 640, 480);
}
}


for (size_t i=0; i<goal->max_num_sweeps && i<matchingObservations.size(); i++)
{
Expand Down

0 comments on commit 00327df

Please sign in to comment.