Laser Scanner communication main routine. More...
#include <sick_scan/sick_scan_common_nw.h>
#include <sick_scan/sick_scan_common.h>
#include <sick_scan/sick_scan_messages.h>
#include <sick_scan/sick_generic_radar.h>
#include <sick_scan/sick_generic_field_mon.h>
#include <sick_scan/helper/angle_compensator.h>
#include <sick_scan/sick_scan_config_internal.h>
#include <sick_scan/sick_scan_parse_util.h>
#include <sick_scan/sick_lmd_scandata_parser.h>
#include <sick_scan/sick_nav_scandata_parser.h>
#include "sick_scan/binScanf.hpp"
#include "sick_scan/dataDumper.h"
#include <cstdio>
#include <cstring>
#include <math.h>
#include <float.h>
#include "sick_scan/tcp/colaa.hpp"
#include "sick_scan/tcp/colab.hpp"
#include <map>
#include <climits>
#include <sick_scan/sick_generic_imu.h>
#include <sick_scan/sick_scan_services.h>
Go to the source code of this file.
Namespaces | |
sick_scan_xd | |
Macros | |
#define | _USE_MATH_DEFINES |
#define | deg2rad_const (0.017453292519943295769236907684886f) |
#define | rad2deg(x) ((x) / M_PI * 180.0) |
#define | RETURN_ERROR_ON_RESPONSE_TIMEOUT(result, reply) if(((result)!=ExitSuccess)&&((reply).empty()))return(ExitError) |
Functions | |
const std::string | binScanfGetStringFromVec (std::vector< unsigned char > *replyDummy, int off, long len) |
return diagnostic error code (small helper function) This small helper function was introduced to allow the compiling under Visual c++. More... | |
static bool & | isFieldEvaluationActive () |
static std::vector< int > | parseFirmwareVersion (const std::string &scannertype, const std::string &deviceIdentStr) |
unsigned char | sick_scan_xd::sick_crc8 (unsigned char *msgBlock, int len) |
calculate crc-code for last byte of binary message XOR-calucation is done ONLY over message content (i.e. skipping the first 8 Bytes holding 0x02020202 <Length Information as 4-byte long>) More... | |
std::vector< unsigned char > | stringToVector (std::string s) |
Universal swapping function. More... | |
std::string | sick_scan_xd::stripControl (std::vector< unsigned char > s, int max_strlen=-1) |
Converts a SOPAS command to a human readable string. More... | |
void | swap_endian (unsigned char *ptr, int numBytes) |
Universal swapping function. More... | |
Variables | |
static const int | MAX_STR_LEN = 1024 |
Laser Scanner communication main routine.
Copyright (C) 2013, Osnabrueck University Copyright (C) 2017-2022, Ing.-Buero Dr. Michael Lehning, Hildesheim Copyright (C) 2017-2022, SICK AG, Waldkirch
All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Osnabrueck University nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. * Neither the name of SICK AG nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission * Neither the name of Ing.-Buero Dr. Michael Lehning nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Last modified: 28th May 2018
Authors: Michael Lehning <michael.lehning@lehning.de> Jochen Sprickerhof <jochen@sprickerhof.de> Martin Günther <mguenthe@uos.de>
Based on the TiM communication example by SICK AG.
Definition in file sick_scan_common.cpp.
#define _USE_MATH_DEFINES |
Definition at line 92 of file sick_scan_common.cpp.
#define deg2rad_const (0.017453292519943295769236907684886f) |
Definition at line 101 of file sick_scan_common.cpp.
#define rad2deg | ( | x | ) | ((x) / M_PI * 180.0) |
Definition at line 98 of file sick_scan_common.cpp.
#define RETURN_ERROR_ON_RESPONSE_TIMEOUT | ( | result, | |
reply | |||
) | if(((result)!=ExitSuccess)&&((reply).empty()))return(ExitError) |
Definition at line 116 of file sick_scan_common.cpp.
const std::string binScanfGetStringFromVec | ( | std::vector< unsigned char > * | replyDummy, |
int | off, | ||
long | len | ||
) |
return diagnostic error code (small helper function) This small helper function was introduced to allow the compiling under Visual c++.
Convert part of unsigned char vector into a std::string
replyDummy | Pointer to byte block hold in vector |
off | Starting Position for copy command |
len | Number of bytes which should be copied |
Definition at line 176 of file sick_scan_common.cpp.
|
static |
Definition at line 206 of file sick_scan_common.cpp.
|
static |
Definition at line 188 of file sick_scan_common.cpp.
std::vector<unsigned char> stringToVector | ( | std::string | s | ) |
Universal swapping function.
<todo> doku.
ptr | Pointer to datablock |
numBytes | : size of variable in bytes |
Definition at line 145 of file sick_scan_common.cpp.
void swap_endian | ( | unsigned char * | ptr, |
int | numBytes | ||
) |
Universal swapping function.
ptr | Pointer to datablock |
numBytes | : size of variable in bytes |
Definition at line 125 of file sick_scan_common.cpp.
|
static |
Definition at line 118 of file sick_scan_common.cpp.