/*--------------------------------------------------------------- readFromStream ---------------------------------------------------------------*/ void CLogFileRecord_ND::readFromStream(mrpt::utils::CStream &in,int version) { switch(version) { case 0: { int32_t n; in >> n; gaps_ini.resize(n); gaps_end.resize(n); in.ReadBuffer( &(*gaps_ini.begin()), sizeof(gaps_ini[0]) * n ); in.ReadBuffer( &(*gaps_end.begin()), sizeof(gaps_end[0]) * n ); in >> n; gaps_eval.resize(n); in.ReadBuffer( &(*gaps_eval.begin()), sizeof(gaps_eval[0]) * n ); in >> selectedSector >> evaluation >> riskEvaluation >> n; situation = (CHolonomicND::TSituations) n; } break; case 1: { uint32_t n; in >> gaps_ini >> gaps_end >> gaps_eval; in >> selectedSector >> evaluation >> riskEvaluation >> n; situation = (CHolonomicND::TSituations) n; } break; default: MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(version) }; }
/** Dump the options of the metric map in human-readable format */ void TMetricMapInitializer::dumpToTextStream(mrpt::utils::CStream &out) const { out.printf("-------------------------TMetricMapInitializer --------------------------\n"); out.printf("================ C++ Class: '%s'\n", this->metricMapClassType->className); this->genericMapParams.dumpToTextStream(out); // Class-specific: this->dumpToTextStream_map_specific(out); }
void Message_NMEA_ZDA::dumpToStream( mrpt::utils::CStream &out ) const { out.printf("[NMEA ZDA datum]\n"); out.printf(" UTC time-stamp: %02u:%02u:%02.03f\n", fields.UTCTime.hour, fields.UTCTime.minute, fields.UTCTime.sec ); out.printf(" Date (DD/MM/YY): %02u/%02u/%04u\n ", (unsigned)fields.date_day,(unsigned)fields.date_month, (unsigned)fields.date_year); }
/*--------------------------------------------------------------- dumpToTextStream ---------------------------------------------------------------*/ void CMultiMetricMapPDF::TPredictionParams::dumpToTextStream(mrpt::utils::CStream &out) const { out.printf("\n----------- [CMultiMetricMapPDF::TPredictionParams] ------------ \n\n"); out.printf("pfOptimalProposal_mapSelection = %i\n", pfOptimalProposal_mapSelection ); out.printf("ICPGlobalAlign_MinQuality = %f\n", ICPGlobalAlign_MinQuality ); KLD_params.dumpToTextStream(out); icp_params.dumpToTextStream(out); out.printf("\n"); }
void Message_NMEA_GLL::dumpToStream( mrpt::utils::CStream &out ) const { out.printf("[NMEA GLL datum]\n"); out.printf(" Longitude: %.09f deg Latitude: %.09f deg Validity: '%c'\n", fields.longitude_degrees, fields.latitude_degrees, fields.validity_char ); out.printf(" UTC time-stamp: %02u:%02u:%02.03f\n", fields.UTCTime.hour, fields.UTCTime.minute, fields.UTCTime.sec); }
void CRandomFieldGridMap3D::readFromStream(mrpt::utils::CStream &in, int version) { switch (version) { case 0: { dyngridcommon_readFromStream(in); // To assure compatibility: The size of each cell: uint32_t n; in >> n; ASSERT_EQUAL_(n, static_cast<uint32_t>(sizeof(TRandomFieldVoxel))); // Load the map contents: in >> n; m_map.resize(n); // Read the note in writeToStream() #if MRPT_IS_BIG_ENDIAN for (uint32_t i = 0; i<n; i++) in >> m_map[i].mean_value >> m_map[i].stddev_value; #else // Little endian: just read all at once: in.ReadBuffer(&m_map[0], sizeof(m_map[0])*m_map.size()); #endif in >> insertionOptions.GMRF_lambdaPrior >> insertionOptions.GMRF_skip_variance; } break; default: MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(version); }; }
void CRandomFieldGridMap3D::writeToStream(mrpt::utils::CStream &out, int *version) const { if (version) *version = 0; else { dyngridcommon_writeToStream(out); // To assure compatibility: The size of each cell: uint32_t n = static_cast<uint32_t>(sizeof(TRandomFieldVoxel)); out << n; // Save the map contents: n = static_cast<uint32_t>(m_map.size()); out << n; // Save the "m_map": This requires special handling for big endian systems: #if MRPT_IS_BIG_ENDIAN for (uint32_t i = 0; i<n; i++) { out << m_map[i].mean_value << m_map[i].stddev_value; } #else // Little endian: just write all at once: out.WriteBuffer(&m_map[0], sizeof(m_map[0])*m_map.size()); #endif out << insertionOptions.GMRF_lambdaPrior << insertionOptions.GMRF_skip_variance; } }
void COutputLogger::TMsg::writeToStream(mrpt::utils::CStream& out) const { const std::string str = getAsString(); out.printf("%s", str.c_str()); #ifdef _MSC_VER OutputDebugStringA(str.c_str()); #endif }
/*--------------------------------------------------------------- readFromStream ---------------------------------------------------------------*/ void CMatrixB::readFromStream(mrpt::utils::CStream &in, int version) { switch(version) { case 0: { uint32_t size_bool; in >> size_bool; if ( size_bool != sizeof(m_Val[0][0]) ) THROW_EXCEPTION("Error: size of 'bool' is different in serialized data!") uint32_t nRows,nCols; // First, write the number of rows and columns: in >> nRows >> nCols; setSize(nRows,nCols); if (nRows>0 && nCols>0) for (unsigned int i=0;i<nRows;i++) in.ReadBuffer(m_Val[i],sizeof(m_Val[0][0])*m_Cols); } break; default: MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(version) }; }
void CGasConcentrationGridMap2D::TMapDefinition::dumpToTextStream_map_specific(mrpt::utils::CStream &out) const { out.printf("MAP TYPE = %s\n", mrpt::utils::TEnumType<CGasConcentrationGridMap2D::TMapRepresentation>::value2name(mapType).c_str() ); LOADABLEOPTS_DUMP_VAR(min_x , float); LOADABLEOPTS_DUMP_VAR(max_x , float); LOADABLEOPTS_DUMP_VAR(min_y , float); LOADABLEOPTS_DUMP_VAR(max_y , float); LOADABLEOPTS_DUMP_VAR(resolution , float); this->insertionOpts.dumpToTextStream(out); }
/*--------------------------------------------------------------- dumpToTextStream ---------------------------------------------------------------*/ void CIncrementalMapPartitioner::TOptions::dumpToTextStream(mrpt::utils::CStream &out) const { out.printf("\n----------- [CIncrementalMapPartitioner::TOptions] ------------ \n\n"); out.printf("partitionThreshold = %f\n",partitionThreshold); out.printf("gridResolution = %f\n",gridResolution); out.printf("minDistForCorrespondence = %f\n",minDistForCorrespondence); out.printf("forceBisectionOnly = %c\n",forceBisectionOnly ? 'Y':'N'); out.printf("useMapMatching = %c\n",useMapMatching ? 'Y':'N'); out.printf("minimumNumberElementsEachCluster = %i\n",minimumNumberElementsEachCluster); }
/*--------------------------------------------------------------- Implements the writing to a CStream capability of CSerializable objects ---------------------------------------------------------------*/ void CWirelessPowerGridMap2D::writeToStream(mrpt::utils::CStream &out, int *version) const { if (version) *version = 5; else { dyngridcommon_writeToStream(out); // To ensure compatibility: The size of each cell: uint32_t n = static_cast<uint32_t>(sizeof( TRandomFieldCell )); out << n; // Save the map contents: n = static_cast<uint32_t>(m_map.size()); out << n; // Save the "m_map": This requires special handling for big endian systems: #if MRPT_IS_BIG_ENDIAN for (uint32_t i=0;i<n;i++) { out << m_map[i].kf_mean << m_map[i].dm_mean << m_map[i].dmv_var_mean; } #else // Little endian: just write all at once: out.WriteBuffer( &m_map[0], sizeof(m_map[0])*m_map.size() ); // TODO: Do this endianness safe!! #endif // Version 1: Save the insertion options: out << uint8_t(m_mapType) << m_cov << m_stackedCov; out << insertionOptions.sigma << insertionOptions.cutoffRadius << insertionOptions.R_min << insertionOptions.R_max << insertionOptions.KF_covSigma << insertionOptions.KF_initialCellStd << insertionOptions.KF_observationModelNoise << insertionOptions.KF_defaultCellMeanValue << insertionOptions.KF_W_size; // New in v3: out << m_average_normreadings_mean << m_average_normreadings_var << uint64_t(m_average_normreadings_count); out << genericMapParams; // v4 } }
/*--------------------------------------------------------------- writeToStream ---------------------------------------------------------------*/ void CMemoryChunk::writeToStream(mrpt::utils::CStream &out, int *out_Version) const { if (out_Version) *out_Version = 0; else { out << static_cast<uint64_t>(m_bytesWritten); if (m_bytesWritten) { ASSERT_(m_memory.get()) out.WriteBuffer(m_memory.get(),m_bytesWritten); } } }
void CRenderizable::writeToStreamRender(mrpt::utils::CStream &out) const { // MRPT 0.9.5 svn 2774 (Dec 14th 2011): // Added support of versioning at this level of serialization too. // Should have been done from the beginning, terrible mistake on my part. // Now, the only solution is something as ugly as this: // // For reference: In the past this started as: // out << m_name << (float)(m_color.R) << (float)(m_color.G) << (float)(m_color.B) << (float)(m_color.A); // ... const uint8_t serialization_version = 0; // can't be >31 (but it would be mad geting to that situation!) const bool all_scales_equal = (m_scale_x==m_scale_y && m_scale_z==m_scale_x); const bool all_scales_unity = (all_scales_equal && m_scale_x==1.0f); const uint8_t magic_signature[2] = { 0xFF, // bit7: fixed to 1 to mark this new header format // bit6: whether the 3 scale{x,y,z} are equal to 1.0 // bit5: whether the 3 scale{x,y,z} are equal to each other static_cast<uint8_t>( serialization_version | (all_scales_unity ? 0xC0 : (all_scales_equal ? 0xA0 : 0x80) ) ) }; out << magic_signature[0] << magic_signature[1]; // "m_name" const uint16_t nameLen = static_cast<uint16_t>(m_name.size()); out << nameLen; if (nameLen) out.WriteBuffer(m_name.c_str(),m_name.size()); // Color, as u8: out << m_color.R << m_color.G << m_color.B << m_color.A; // the rest of fields: out << (float)m_pose.x() << (float)m_pose.y() << (float)m_pose.z() << (float)m_pose.yaw() << (float)m_pose.pitch() << (float)m_pose.roll(); if (!all_scales_unity) { if (all_scales_equal) out << m_scale_x; else out << m_scale_x << m_scale_y << m_scale_z; } out << m_show_name << m_visible; }
/*--------------------------------------------------------------- writeToStream ---------------------------------------------------------------*/ void CMatrixB::writeToStream(mrpt::utils::CStream &out, int *out_Version) const { if (out_Version) *out_Version = 0; else { out << (uint32_t)sizeof(m_Val[0][0]); // First, write the number of rows and columns: out << (uint32_t)m_Rows << (uint32_t)m_Cols; if (m_Rows>0 && m_Cols>0) for (unsigned int i=0;i<m_Rows;i++) out.WriteBuffer(m_Val[i],sizeof(m_Val[0][0])*m_Cols); } }
/*--------------------------------------------------------------- readFromStream ---------------------------------------------------------------*/ void CMemoryChunk::readFromStream(mrpt::utils::CStream &in, int version) { switch(version) { case 0: { uint64_t N; in >> N; resize(N); m_bytesWritten = N; m_position = 0; if (N) in.ReadBuffer( m_memory.get(), N ); } break; default: MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(version) }; }
void Message_NMEA_RMC::dumpToStream( mrpt::utils::CStream &out ) const { out.printf("[NMEA RMC datum]\n"); out.printf(" Positioning mode: `%c`\n ", (char)fields.positioning_mode); out.printf(" UTC time-stamp: %02u:%02u:%02.03f\n", fields.UTCTime.hour, fields.UTCTime.minute, fields.UTCTime.sec ); out.printf(" Date (DD/MM/YY): %02u/%02u/%02u\n ", (unsigned)fields.date_day,(unsigned)fields.date_month, (unsigned)fields.date_year); out.printf(" Longitude: %.09f deg Latitude: %.09f deg Valid?: '%c'\n", fields.longitude_degrees, fields.latitude_degrees, fields.validity_char ); out.printf(" Speed: %.05f knots Direction:%.03f deg.\n ", fields.speed_knots, fields.direction_degrees ); out.printf(" Magnetic variation direction: %.04f deg\n ", fields.magnetic_dir); }
/*--------------------------------------------------------------- dumpToTextStream ---------------------------------------------------------------*/ void CHMTSLAM::TOptions::dumpToTextStream(mrpt::utils::CStream &out) const { out.printf("\n----------- [CHMTSLAM::TOptions] ------------ \n\n"); LOADABLEOPTS_DUMP_VAR( LOG_OUTPUT_DIR, string ); LOADABLEOPTS_DUMP_VAR( LOG_FREQUENCY, int); LOADABLEOPTS_DUMP_VAR( SLAM_METHOD, int); LOADABLEOPTS_DUMP_VAR( SLAM_MIN_DIST_BETWEEN_OBS, float ); LOADABLEOPTS_DUMP_VAR_DEG( SLAM_MIN_HEADING_BETWEEN_OBS ); LOADABLEOPTS_DUMP_VAR( MIN_ODOMETRY_STD_XY, float ); LOADABLEOPTS_DUMP_VAR_DEG( MIN_ODOMETRY_STD_PHI ); LOADABLEOPTS_DUMP_VAR( random_seed, int ); AA_options.dumpToTextStream(out); pf_options.dumpToTextStream(out); KLD_params.dumpToTextStream(out); defaultMapsInitializers.dumpToTextStream(out); TLC_grid_options.dumpToTextStream(out); TLC_fabmap_options.dumpToTextStream(out); }
/*--------------------------------------------------------------- dumpToTextStream ---------------------------------------------------------------*/ void COccupancyGridMap2D::TLikelihoodOptions::dumpToTextStream(mrpt::utils::CStream &out) const { out.printf("\n----------- [COccupancyGridMap2D::TLikelihoodOptions] ------------ \n\n"); out.printf("likelihoodMethod = "); switch (likelihoodMethod) { case lmMeanInformation: out.printf("lmMeanInformation"); break; case lmRayTracing: out.printf("lmRayTracing"); break; case lmConsensus: out.printf("lmConsensus"); break; case lmCellsDifference: out.printf("lmCellsDifference"); break; case lmLikelihoodField_Thrun: out.printf("lmLikelihoodField_Thrun"); break; case lmLikelihoodField_II: out.printf("lmLikelihoodField_II"); break; case lmConsensusOWA: out.printf("lmConsensusOWA"); break; default: out.printf("UNKNOWN!!!"); break; } out.printf("\n"); out.printf("enableLikelihoodCache = %c\n", enableLikelihoodCache ? 'Y':'N'); out.printf("LF_stdHit = %f\n", LF_stdHit ); out.printf("LF_zHit = %f\n", LF_zHit ); out.printf("LF_zRandom = %f\n", LF_zRandom ); out.printf("LF_maxRange = %f\n", LF_maxRange ); out.printf("LF_decimation = %u\n", LF_decimation ); out.printf("LF_maxCorrsDistance = %f\n", LF_maxCorrsDistance ); out.printf("LF_useSquareDist = %c\n", LF_useSquareDist ? 'Y':'N'); out.printf("LF_alternateAverageMethod = %c\n", LF_alternateAverageMethod ? 'Y':'N'); out.printf("MI_exponent = %f\n", MI_exponent ); out.printf("MI_skip_rays = %u\n", MI_skip_rays ); out.printf("MI_ratio_max_distance = %f\n", MI_ratio_max_distance ); out.printf("rayTracing_useDistanceFilter = %c\n", rayTracing_useDistanceFilter ? 'Y':'N'); out.printf("rayTracing_decimation = %u\n", rayTracing_decimation ); out.printf("rayTracing_stdHit = %f\n", rayTracing_stdHit ); out.printf("consensus_takeEachRange = %u\n", consensus_takeEachRange ); out.printf("consensus_pow = %.02f\n", consensus_pow); out.printf("OWA_weights = ["); for (size_t i=0;i<OWA_weights.size();i++) { if (i<3 || i>(OWA_weights.size()-3)) out.printf("%.03f ",OWA_weights[i]); else if (i==3 && OWA_weights.size()>6) out.printf(" ... "); } out.printf("] (size=%u)\n",(unsigned)OWA_weights.size()); out.printf("\n"); }
// -------------------------------------------------- // dumpToTextStream // -------------------------------------------------- void TMultiResDescMatchOptions::dumpToTextStream( mrpt::utils::CStream &out) const { out.printf("\n----------- [vision::TMultiResDescMatchOptions] ------------ \n"); out.printf("Use orientation filter?: "); if( useOriFilter ) { out.printf("Yes\n"); out.printf("· Orientation threshold: %.1f deg\n", RAD2DEG(oriThreshold) ); } else out.printf("No\n"); out.printf("Use depth filter?: "); if( useDepthFilter ) out.printf("Yes\n"); else { out.printf("No\n" ); out.printf("Lowest scale in list1: %d\n", lowScl1 ); out.printf("Highest scale in list1: %d\n", highScl1 ); out.printf("Lowest scale in list2: %d\n", lowScl2 ); out.printf("Highest scale in list2: %d\n", highScl2 ); } out.printf("#frames last seen threshold: %d\n", lastSeenThreshold ); out.printf("#frames to be stable threshold: %d\n", timesSeenThreshold ); out.printf("min. # features in system: %d\n", minFeaturesToFind ); out.printf("min. # features to be lost: %d\n", minFeaturesToBeLost ); out.printf("Matching threshold: %.2f\n", matchingThreshold ); out.printf("Matching ratio threshold: %.2f\n", matchingRatioThreshold ); out.printf("Size of the search window: %d px\n", searchAreaSize ); out.printf("-------------------------------------------------------- \n"); } // end-dumpToTextStream
void CFeature::dumpToTextStream( mrpt::utils::CStream &out) const { out.printf("\n----------- [vision::CFeature] ------------ \n"); out.printf("Feature ID: %d\n", (int)ID); out.printf("Coordinates: (%.2f,%.2f) px\n", x, y ); out.printf("PatchSize: %d\n", patchSize ); out.printf("Type: "); switch( type ) { case -1: out.printf("Not defined\n"); break; case 0: out.printf("KLT\n"); break; case 1: out.printf("Harris\n"); break; case 2: out.printf("BCD\n"); break; case 3: out.printf("SIFT\n"); break; case 4: out.printf("SURF\n"); break; case 5: out.printf("Beacon\n"); break; case 6: out.printf("FAST\n"); break; case 7: out.printf("FASTER-9\n"); break; case 8: out.printf("FASTER-10\n"); break; case 9: out.printf("FASTER-12\n"); break; case 10:out.printf("ORB"); break; } out.printf("Status: "); switch( track_status ) { case 0: out.printf("Idle\n"); break; case 1: out.printf("[KLT] Out of bounds [KLT]\n"); break; case 5: out.printf("[KLT] Tracked\n"); break; case 10: out.printf("[KLT] Lost\n"); break; } out.printf("Response: %.2f\n", response ); out.printf("Main orientation: %.2f\n", orientation ); out.printf("Main scale: %.2f\n", scale ); out.printf("# frames seen: %d\n", nTimesSeen ); out.printf("# frames not seen: %d\n", nTimesNotSeen ); out.printf("# frames since last seen: %d\n", nTimesLastSeen ); out.printf("Initial Depth: %.2f m\n", initialDepth ); out.printf("Depth: %.2f m\n", depth ); out.printf("3D point: (%.2f,%.2f,%.2f) m\n", p3D.x, p3D.y, p3D.z ); out.printf("Is point feature?: "); isPointFeature() ? out.printf("Yes\n") : out.printf("No\n"); out.printf("Has SIFT descriptor?: "); descriptors.hasDescriptorSIFT() ? out.printf("Yes\n") : out.printf("No\n"); out.printf("Has SURF descriptor?: "); descriptors.hasDescriptorSURF() ? out.printf("Yes\n") : out.printf("No\n"); out.printf("Has Spin image descriptor?: "); descriptors.hasDescriptorSpinImg() ? out.printf("Yes\n") : out.printf("No\n"); out.printf("Has Polar descriptor?: "); descriptors.hasDescriptorPolarImg() ? out.printf("Yes\n") : out.printf("No\n"); out.printf("Has Log Polar descriptor?: "); descriptors.hasDescriptorLogPolarImg() ? out.printf("Yes\n") : out.printf("No\n"); out.printf("Has ORB descriptor?: "); descriptors.hasDescriptorORB() ? out.printf("Yes\n") : out.printf("No\n"); out.printf("Has multiscale?: "); if( !descriptors.hasDescriptorMultiSIFT() ) out.printf("No\n"); else { out.printf("Yes [%d]\n", (int)multiScales.size()); for( int k = 0; k < (int)multiScales.size(); ++k ) { out.printf(" · Scale %d: %.2f\n", k, multiScales[k] ); for( int m = 0; m < (int)multiOrientations[k].size(); ++m ) { out.printf(" ·· Orientation %d: %.2f\n", m, multiOrientations[k][m] ); out.printf(" ·· [D] " ); for( int n = 0; n < (int)descriptors.multiSIFTDescriptors[k][m].size(); ++n ) out.printf("%d ", descriptors.multiSIFTDescriptors[k][m][n] ); out.printf("\n"); if( multiHashCoeffs.size() > 0 ) out.printf(" ·· HASH coefficients %d,%d,%d\n", multiHashCoeffs[k][m][0], multiHashCoeffs[k][m][1],multiHashCoeffs[k][m][2] ); }//end-for-m }//end-for-k } // end else } // end dumpToTextStream
void Message_NMEA_GGA::dumpToStream( mrpt::utils::CStream &out ) const { out.printf("[NMEA GGA datum]\n"); out.printf(" Longitude: %.09f deg Latitude: %.09f deg Height: %.03f m\n", fields.longitude_degrees, fields.latitude_degrees, fields.altitude_meters ); out.printf(" Geoidal distance: %.03f m Orthometric alt.: %.03f m Corrected ort. alt.: %.03f m\n", fields.geoidal_distance, fields.orthometric_altitude, fields.corrected_orthometric_altitude ); out.printf(" UTC time-stamp: %02u:%02u:%02.03f #sats=%2u ", fields.UTCTime.hour, fields.UTCTime.minute, fields.UTCTime.sec, fields.satellitesUsed ); out.printf("Fix mode: %u ",fields.fix_quality); switch( fields.fix_quality ) { case 0: out.printf("(Invalid)\n"); break; case 1: out.printf("(GPS fix)\n"); break; case 2: out.printf("(DGPS fix)\n"); break; case 3: out.printf("(PPS fix)\n"); break; case 4: out.printf("(Real Time Kinematic/RTK Fixed)\n"); break; case 5: out.printf("(Real Time Kinematic/RTK Float)\n"); break; case 6: out.printf("(Dead Reckoning)\n"); break; case 7: out.printf("(Manual)\n"); break; case 8: out.printf("(Simulation)\n"); break; case 9: out.printf("(mmGPS + RTK Fixed)\n"); break; case 10: out.printf("(mmGPS + RTK Float)\n"); break; default: out.printf("(UNKNOWN!)\n"); break; }; out.printf(" HDOP (Horizontal Dilution of Precision): "); if (fields.thereis_HDOP) out.printf(" %f\n", fields.HDOP); else out.printf(" N/A\n"); }
void CRandomFieldGridMap3D::TInsertionOptions::dumpToTextStream(mrpt::utils::CStream &out) const { out.printf("GMRF_lambdaPrior = %f\n", GMRF_lambdaPrior); out.printf("GMRF_skip_variance = %s\n", GMRF_skip_variance ? "true":"false"); }
void Message_TOPCON_PZS::dumpToStream( mrpt::utils::CStream &out ) const { out.printf("\n[TopCon PZS datum]\n"); out.printf(" Longitude: %.09f deg Latitude: %.09f deg Height: %.03f m (%.03f m without NBeam) \n", longitude_degrees, latitude_degrees, height_meters, RTK_height_meters); out.printf(" PZL-ID: %i Angle trans: %.05f deg\n ", (int)nId, angle_transmitter ); out.printf(" Fix: %i ",(int)Fix); out.printf(" Error: %i ",(int)error); out.printf(" Battery levels: TX=%i RX=%i\n ",TXBattery,RXBattery); out.printf(" hasCartesianPosVel= %s", hasCartesianPosVel ? "YES -> ":"NO\n"); if (hasCartesianPosVel) { out.printf(" x=%f y=%f z=%f\n",cartesian_x,cartesian_y,cartesian_z); out.printf(" vx=%f vy=%f vz=%f\n",cartesian_vx,cartesian_vy,cartesian_vz); } out.printf("hasPosCov = %s", hasPosCov ? "YES\n":"NO\n"); if (hasPosCov) out.printf("%s\n", pos_covariance.inMatlabFormat().c_str() ); out.printf("hasVelCov = %s", hasVelCov ? "YES\n":"NO\n"); if (hasVelCov) out.printf("%s\n", vel_covariance.inMatlabFormat().c_str() ); out.printf("hasStats = %s", hasStats? "YES: ":"NO\n"); if(hasStats) out.printf("GPS sats used: %i GLONASS sats used: %i RTK Fix progress:%i%%\n", (int)stats_GPS_sats_used, (int)stats_GLONASS_sats_used,(int)stats_rtk_fix_progress); }
/*--------------------------------------------------------------- dumpToTextStream ---------------------------------------------------------------*/ void CICP::TConfigParams::dumpToTextStream(mrpt::utils::CStream &out) const { out.printf("\n----------- [CICP::TConfigParams] ------------ \n\n"); out.printf("ICP_algorithm = %s\n", mrpt::utils::TEnumType<TICPAlgorithm>::value2name(ICP_algorithm).c_str() ); out.printf("ICP_covariance_method = %s\n", mrpt::utils::TEnumType<TICPCovarianceMethod>::value2name(ICP_covariance_method).c_str() ); out.printf("maxIterations = %i\n",maxIterations); out.printf("minAbsStep_trans = %f\n",minAbsStep_trans); out.printf("minAbsStep_rot = %f\n",minAbsStep_rot); out.printf("thresholdDist = %f\n",thresholdDist); out.printf("thresholdAng = %f deg\n",RAD2DEG(thresholdAng)); out.printf("ALFA = %f\n",ALFA); out.printf("smallestThresholdDist = %f\n",smallestThresholdDist); out.printf("onlyClosestCorrespondences = %c\n",onlyClosestCorrespondences ? 'Y':'N'); out.printf("onlyUniqueRobust = %c\n",onlyUniqueRobust ? 'Y':'N'); out.printf("covariance_varPoints = %f\n",covariance_varPoints); out.printf("doRANSAC = %c\n",doRANSAC ? 'Y':'N'); out.printf("ransac_minSetSize = %i\n",ransac_minSetSize); out.printf("ransac_maxSetSize = %i\n",ransac_maxSetSize); out.printf("ransac_mahalanobisDistanceThreshold = %f\n",ransac_mahalanobisDistanceThreshold); out.printf("ransac_nSimulations = %i\n",ransac_nSimulations); out.printf("ransac_fuseByCorrsMatch = %c\n",ransac_fuseByCorrsMatch ? 'Y':'N'); out.printf("ransac_fuseMaxDiffXY = %f\n",ransac_fuseMaxDiffXY); out.printf("ransac_fuseMaxDiffPhi = %f deg\n",RAD2DEG( ransac_fuseMaxDiffPhi )); out.printf("normalizationStd = %f\n",normalizationStd); out.printf("kernel_rho = %f\n",kernel_rho); out.printf("use_kernel = %c\n",use_kernel ? 'Y':'N'); out.printf("Axy_aprox_derivatives = %f\n",Axy_aprox_derivatives ); out.printf("LM_initial_lambda = %f\n",LM_initial_lambda); out.printf("skip_cov_calculation = %c\n",skip_cov_calculation ? 'Y':'N'); out.printf("skip_quality_calculation = %c\n",skip_quality_calculation ? 'Y':'N'); out.printf("corresponding_points_decimation = %u\n",(unsigned int)corresponding_points_decimation); out.printf("\n"); }
// -------------------------------------------------- // dumpToTextStream // -------------------------------------------------- void TMultiResDescOptions::dumpToTextStream( mrpt::utils::CStream &out) const { out.printf("\n----------- [vision::TMultiResDescOptions] ------------ \n"); out.printf("Base patch size: %d px\n", basePSize); out.printf("Lowest scale to compute: %d\n", comLScl ); out.printf("Highest scale to compute: %d\n", comHScl ); out.printf("Image smoothing sigma: %.2f px\n", sg1 ); out.printf("Orientation histogram sigma: %.2f\n", sg2 ); out.printf("Descriptor histogram sigma: %.2f\n", sg3 ); out.printf("Compute depth: "); if( computeDepth ) { out.printf("Yes\n"); out.printf("Focal length: %.2f px\n", fx ); out.printf("Principal point (cx): %.2f px\n", cx ); out.printf("Principal point (cy): %.2f px\n", cy ); out.printf("Baseline: %.2f m\n", baseline ); } else out.printf("No\n"); out.printf("Compute Hash Coeffs: "); if( computeHashCoeffs ) out.printf("Yes\n"); else out.printf("No\n"); out.printf("Blur image previously: "); if( blurImage ) out.printf("Yes\n"); else out.printf("No\n"); out.printf("Scales: "); for(unsigned int k = 0; k < scales.size(); ++k) out.printf( "%.2f ", scales[k] ); out.printf("\n"); out.printf("-------------------------------------------------------- \n"); } // end-dumpToTextStream
void CRenderizable::readFromStreamRender(mrpt::utils::CStream &in) { // MRPT 0.9.5 svn 2774 (Dec 14th 2011): // See comments in CRenderizable::writeToStreamRender() for the employed serialization mechanism. // // Read signature: union { uint8_t magic_signature[2+2]; // (the extra 4 bytes will be used only for the old format) uint32_t magic_signature_uint32; // So we can interpret the 4bytes above as a 32bit number cleanly. }; in >> magic_signature[0] >> magic_signature[1]; const bool is_new_format = (magic_signature[0]==0xFF) && ((magic_signature[1]&0x80)!=0); if (is_new_format) { // NEW FORMAT: uint8_t serialization_version = (magic_signature[1] & 0x1F); const bool all_scales_unity = ((magic_signature[1]&0x40)!=0); const bool all_scales_equal_but_not_unity = ((magic_signature[1]&0x20)!=0); switch(serialization_version) { case 0: { // "m_name" uint16_t nameLen; in >> nameLen; m_name.resize(nameLen); if (nameLen) in.ReadBuffer((void*)(&m_name[0]),m_name.size()); // Color, as u8: in >> m_color.R >> m_color.G >> m_color.B >> m_color.A; // the rest of fields: float x,y,z,yaw,pitch,roll; in >> x >> y >> z >> yaw >> pitch >> roll; m_pose.x(x); m_pose.y(y); m_pose.z(z); m_pose.setYawPitchRoll( yaw,pitch,roll ); if (all_scales_unity) m_scale_x=m_scale_y=m_scale_z=1; else { if (all_scales_equal_but_not_unity) { in >> m_scale_x; m_scale_y = m_scale_z = m_scale_x; } else in >> m_scale_x >> m_scale_y >> m_scale_z; } in >> m_show_name >> m_visible; } break; default: THROW_EXCEPTION_CUSTOM_MSG1("Can't parse CRenderizable standard data field: corrupt data stream or format in a newer MRPT format? (serialization version=%u)",static_cast<unsigned int>(serialization_version)) }; } else {
void Message_NMEA_VTG::dumpToStream( mrpt::utils::CStream &out ) const { out.printf("[NMEA VTG datum]\n"); out.printf(" True track: %.03f deg Magnetic track: %.03f deg\n",fields.true_track, fields.magnetic_track); out.printf(" Ground speed: %.03f knots %.03f km/h\n",fields.ground_speed_knots, fields.ground_speed_kmh); }