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_generic_radar.h>
#include <sick_scan/sick_scan_config_internal.h>
#include "sick_scan/binScanf.hpp"
#include <sick_scan/RadarScan.h>
#include <cstdio>
#include <cstring>
#include <math.h>
#include "sick_scan/tcp/colaa.hpp"
#include "sick_scan/tcp/colab.hpp"
#include <map>
#include <climits>
#include <sick_scan/sick_generic_imu.h>
Go to the source code of this file.
Namespaces | |
namespace | sick_scan |
Defines | |
#define | _USE_MATH_DEFINES |
#define | deg2rad_const (0.017453292519943295769236907684886f) |
#define | rad2deg(x) ((x) / M_PI * 180.0) |
Functions | |
const std::string | binScanfGetStringFromVec (std::vector< unsigned char > *replyDummy, int off, long len) |
Convert part of unsigned char vector into a std::string. | |
static int | getDiagnosticErrorCode () |
return diagnostic error code (small helper function) This small helper function was introduced to allow the compiling under Visual c++. | |
unsigned char | sick_scan::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>) | |
std::vector< unsigned char > | stringToVector (std::string s) |
Universal swapping function. | |
std::string | sick_scan::stripControl (std::vector< unsigned char > s) |
Converts a SOPAS command to a human readable string. | |
void | swap_endian (unsigned char *ptr, int numBytes) |
Universal swapping function. |
Laser Scanner communication main routine.
Copyright (C) 2013, Osnabrück University Copyright (C) 2017-2019, Ing.-Buero Dr. Michael Lehning, Hildesheim Copyright (C) 2017-2019, SICK AG, Waldkirch
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 Osnabrück 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 77 of file sick_scan_common.cpp.
#define deg2rad_const (0.017453292519943295769236907684886f) |
Definition at line 85 of file sick_scan_common.cpp.
Definition at line 82 of file sick_scan_common.cpp.
const std::string binScanfGetStringFromVec | ( | std::vector< unsigned char > * | replyDummy, |
int | off, | ||
long | len | ||
) |
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 153 of file sick_scan_common.cpp.
static int getDiagnosticErrorCode | ( | ) | [static] |
return diagnostic error code (small helper function) This small helper function was introduced to allow the compiling under Visual c++.
Definition at line 136 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 119 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 99 of file sick_scan_common.cpp.