driver/src/sick_scan_common.cpp
bool sick_scan::SickScanCommon::isCompatibleDevice(const std::string identStr) const
  {
    char device_string[7];
    int version_major = -1;
    int version_minor = -1;

    strcpy(device_string, "???");
    // special for TiM3-Firmware
    if (sscanf(identStr.c_str(), "sRA 0 6 %6s E V%d.%d", device_string,
               &version_major, &version_minor) == 3
        && strncmp("TiM3", device_string, 4) == 0
        && version_major >= 2 && version_minor >= 50)
    {
      ROS_ERROR("This scanner model/firmware combination does not support ranging output!");
      ROS_ERROR("Supported scanners: TiM5xx: all firmware versions; TiM3xx: firmware versions < V2.50.");
      ROS_ERROR_STREAM("This is a " << device_string << ", firmware version " << version_major << "." << version_minor);

      return false;
    }

    bool supported = false;

    // DeviceIdent 8 MRS1xxxx 8 1.3.0.0R.
    if (sscanf(identStr.c_str(), "sRA 0 6 %6s E V%d.%d", device_string, &version_major, &version_minor) == 3)
    {
      std::string devStr = device_string;


      if (devStr.compare(0, 4, "TiM5") == 0)
      {
        supported = true;
      }

      if (supported == true)
      {
        ROS_INFO_STREAM("Device " << identStr << " V" << version_major << "." << version_minor << " found and supported by this driver.");
      }

    }

    if ((identStr.find("MRS1xxx") !=
         std::string::npos)   // received pattern contains 4 'x' but we check only for 3 'x' (MRS1104 should be MRS1xxx)
        || (identStr.find("LMS1xxx") != std::string::npos)
        )
    {
      ROS_INFO_STREAM("Deviceinfo " << identStr << " found and supported by this driver.");
      supported = true;
    }


    if (identStr.find("MRS6") !=
        std::string::npos)  // received pattern contains 4 'x' but we check only for 3 'x' (MRS1104 should be MRS1xxx)
    {
      ROS_INFO_STREAM("Deviceinfo " << identStr << " found and supported by this driver.");
      supported = true;
    }

    if (identStr.find("RMS3xx") !=
        std::string::npos)   // received pattern contains 4 'x' but we check only for 3 'x' (MRS1104 should be MRS1xxx)
    {
      ROS_INFO_STREAM("Deviceinfo " << identStr << " found and supported by this driver.");
      supported = true;
    }


    if (supported == false)
    {
      ROS_WARN_STREAM("Device " << device_string << "s V" << version_major << "." << version_minor << " found and maybe unsupported by this driver.");
      ROS_WARN_STREAM("Full SOPAS answer: " << identStr);
    }
    return true;
  }
/*!
  \brief check the identification string
  \param identStr string (got from sopas request)
  \return true, if this driver supports the scanner identified by the identification string
  */
\brief check the identification string
\param identStr string (got from sopas request)
\return true, if this driver supports the scanner identified by the identification string
\ brief check the identification string \ param identStr string ( got from sopas request ) \ return true if this driver supports the scanner identified by the identification string
bool sick_scan::SickScanCommon::isCompatibleDevice(const std::string identStr) const
  {
    char device_string[7];
    int version_major = -1;
    int version_minor = -1;
    strcpy(device_string, "???");
    if (sscanf(identStr.c_str(), "sRA 0 6 %6s E V%d.%d", device_string,
               &version_major, &version_minor) == 3
        && strncmp("TiM3", device_string, 4) == 0
        && version_major >= 2 && version_minor >= 50)
    {
      ROS_ERROR("This scanner model/firmware combination does not support ranging output!");
      ROS_ERROR("Supported scanners: TiM5xx: all firmware versions; TiM3xx: firmware versions < V2.50.");
      ROS_ERROR_STREAM("This is a " << device_string << ", firmware version " << version_major << "." << version_minor);
      return false;
    }
    bool supported = false;
    if (sscanf(identStr.c_str(), "sRA 0 6 %6s E V%d.%d", device_string, &version_major, &version_minor) == 3)
    {
      std::string devStr = device_string;
      if (devStr.compare(0, 4, "TiM5") == 0)
      {
        supported = true;
      }
      if (supported == true)
      {
        ROS_INFO_STREAM("Device " << identStr << " V" << version_major << "." << version_minor << " found and supported by this driver.");
      }
    }
    if ((identStr.find("MRS1xxx") !=
         std::string::npos)   
        || (identStr.find("LMS1xxx") != std::string::npos)
        )
    {
      ROS_INFO_STREAM("Deviceinfo " << identStr << " found and supported by this driver.");
      supported = true;
    }
    if (identStr.find("MRS6") !=
        std::string::npos)  
    {
      ROS_INFO_STREAM("Deviceinfo " << identStr << " found and supported by this driver.");
      supported = true;
    }
    if (identStr.find("RMS3xx") !=
        std::string::npos)   
    {
      ROS_INFO_STREAM("Deviceinfo " << identStr << " found and supported by this driver.");
      supported = true;
    }
    if (supported == false)
    {
      ROS_WARN_STREAM("Device " << device_string << "s V" << version_major << "." << version_minor << " found and maybe unsupported by this driver.");
      ROS_WARN_STREAM("Full SOPAS answer: " << identStr);
    }
    return true;
  }
bool sick_scan :: SickScanCommon :: isCompatibleDevice ( const std :: string identStr ) const { char device_string [ 7 ] ; int version_major = -1 ; int version_minor = -1 ; strcpy ( device_string , " " ) ; if ( sscanf ( identStr . c_str ( ) , " " , device_string , & version_major , & version_minor ) == 3 && strncmp ( " " , device_string , 4 ) == 0 && version_major >= 2 && version_minor >= 50 ) { ROS_ERROR ( " " ) ; ROS_ERROR ( " " ) ; ROS_ERROR_STREAM ( " " << device_string << " " << version_major << " " << version_minor ) ; return false ; } bool supported = false ; if ( sscanf ( identStr . c_str ( ) , " " , device_string , & version_major , & version_minor ) == 3 ) { std :: string devStr = device_string ; if ( devStr . compare ( 0 , 4 , " " ) == 0 ) { supported = true ; } if ( supported == true ) { ROS_INFO_STREAM ( " " << identStr << " " << version_major << " " << version_minor << " " ) ; } } if ( ( identStr . find ( " " ) != std :: string :: npos ) || ( identStr . find ( " " ) != std :: string :: npos ) ) { ROS_INFO_STREAM ( " " << identStr << " " ) ; supported = true ; } if ( identStr . find ( " " ) != std :: string :: npos ) { ROS_INFO_STREAM ( " " << identStr << " " ) ; supported = true ; } if ( identStr . find ( " " ) != std :: string :: npos ) { ROS_INFO_STREAM ( " " << identStr << " " ) ; supported = true ; } if ( supported == false ) { ROS_WARN_STREAM ( " " << device_string << " " << version_major << " " << version_minor << " " ) ; ROS_WARN_STREAM ( " " << identStr ) ; } return true ; }
\brief check the identification string
\param identStr string (got from sopas request)
\return true, if this driver supports the scanner identified by the identification string
\ brief check the identification string \ param identStr string ( got from sopas request ) \ return true if this driver supports the scanner identified by the identification string
// special for TiM3-Firmware // DeviceIdent 8 MRS1xxxx 8 1.3.0.0R. // received pattern contains 4 'x' but we check only for 3 'x' (MRS1104 should be MRS1xxx) // received pattern contains 4 'x' but we check only for 3 'x' (MRS1104 should be MRS1xxx) // received pattern contains 4 'x' but we check only for 3 'x' (MRS1104 should be MRS1xxx)