Exemplo n.º 1
0
IplImage* TrackView::loadFloorPlan( const WbConfig& runConfig )
{
    Collection m_rooms = RoomsCollection();
    m_rooms.SetConfig( runConfig );

    const KeyValue roomId = runConfig.GetKeyValue( RunSchema::roomIdKey );
    const WbConfig roomConfig = m_rooms.ElementById( roomId.ToKeyId() );

    const WbConfig roomLayoutConfig(
                roomConfig.GetSubConfig( RoomLayoutSchema::schemaName ) );

    const QString floorPlanName(
                roomLayoutConfig.GetAbsoluteFileNameFor( "floor_plan.png" ) );

    m_baseImg = cvLoadImage(floorPlanName.toAscii().data(), CV_LOAD_IMAGE_GRAYSCALE);

    return m_baseImg;
}
Exemplo n.º 2
0
bool TrackView::loadMetrics( const WbConfig& runConfig )
{
    WbConfig trackConfig = runConfig.GetSubConfig( TrackRobotSchema::schemaName );

    Collection m_rooms = RoomsCollection();
    m_rooms.SetConfig( runConfig );

    const KeyValue roomId = runConfig.GetKeyValue( RunSchema::roomIdKey );
    const WbConfig roomConfig = m_rooms.ElementById( roomId.ToKeyId() );

    std::vector<WbConfig> camPosConfigs = GetCameraPositionsConfigs(roomConfig);
    const WbConfig firstCamPosConfigForThisRun(camPosConfigs.at(0));

    WbConfig firstCamPosCalibrationCfg;
    firstCamPosCalibrationCfg = firstCamPosConfigForThisRun.GetSubConfig( ExtrinsicCalibrationSchema::schemaName );
    const KeyValue squareSizeCmKey = firstCamPosCalibrationCfg.GetKeyValue( ExtrinsicCalibrationSchema::gridSquareSizeInCmKey );
    const KeyValue squareSizePxKey = firstCamPosCalibrationCfg.GetKeyValue( ExtrinsicCalibrationSchema::gridSquareSizeInPxKey );

    const KeyValue resolutionKey = trackConfig.GetKeyValue( TrackRobotSchema::GlobalTrackingParams::resolution );

    m_metricsScaleFactor = 1.0;

    return true;
}