Visual Servoing Platform version 3.6.0
Loading...
Searching...
No Matches
vpSickLDMRS.h
1/****************************************************************************
2 *
3 * ViSP, open source Visual Servoing Platform software.
4 * Copyright (C) 2005 - 2023 by Inria. All rights reserved.
5 *
6 * This software is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 * See the file LICENSE.txt at the root directory of this source
11 * distribution for additional information about the GNU GPL.
12 *
13 * For using ViSP with software that can not be combined with the GNU
14 * GPL, please contact Inria about acquiring a ViSP Professional
15 * Edition License.
16 *
17 * See https://visp.inria.fr for more information.
18 *
19 * This software was developed at:
20 * Inria Rennes - Bretagne Atlantique
21 * Campus Universitaire de Beaulieu
22 * 35042 Rennes Cedex
23 * France
24 *
25 * If you have questions regarding the use of this file, please contact
26 * Inria at visp@inria.fr
27 *
28 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30 *
31 * Description:
32 * Sick LD-MRS laser driver.
33 *
34*****************************************************************************/
35#ifndef vpSickLDMRS_h
36#define vpSickLDMRS_h
37
38#include <visp3/core/vpConfig.h>
39
40#if !defined(_WIN32) && (defined(__unix__) || defined(__unix) || (defined(__APPLE__) && defined(__MACH__)))
41
42#include <arpa/inet.h>
43#include <iostream>
44#include <string.h>
45#include <vector>
46
47#include <visp3/core/vpColVector.h>
48#include <visp3/core/vpException.h>
49#include <visp3/sensor/vpLaserScan.h>
50#include <visp3/sensor/vpLaserScanner.h>
51#include <visp3/sensor/vpScanPoint.h>
52
104class VISP_EXPORT vpSickLDMRS : public vpLaserScanner
105{
106public:
108 MagicWordC2 = 0xAFFEC0C2
110 };
111 enum DataType {
112 MeasuredData = 0x2202
114 };
115 vpSickLDMRS();
118 : vpLaserScanner(sick), socket_fd(-1), body(NULL), vAngle(), time_offset(0), isFirstMeasure(true),
119 maxlen_body(104000)
120 {
121 *this = sick;
122 };
123 virtual ~vpSickLDMRS();
126 {
127 if (this != &sick) {
128 socket_fd = sick.socket_fd;
129 vAngle = sick.vAngle;
130 time_offset = sick.time_offset;
131 isFirstMeasure = sick.isFirstMeasure;
132 maxlen_body = sick.maxlen_body;
133 if (body)
134 delete[] body;
135 body = new unsigned char[104000];
136 memcpy(body, sick.body, maxlen_body);
137 }
138 return (*this);
139 };
140
141 bool setup(const std::string &ip, int port);
142 bool setup();
143 bool measure(vpLaserScan laserscan[4]);
144
145protected:
146#if defined(_WIN32)
147 SOCKET socket_fd;
148#else
150#endif
151 unsigned char *body;
152 vpColVector vAngle; // constant vertical angle for each layer
156};
157
158#endif
159
160#endif
Implementation of column vector and the associated operations.
Implements a laser scan data structure that contains especially the list of scanned points that have ...
Definition vpLaserScan.h:62
Class that defines a generic laser scanner.
Driver for the Sick LD-MRS laser scanner.
bool isFirstMeasure
unsigned char * body
size_t maxlen_body
vpColVector vAngle
double time_offset
vpSickLDMRS & operator=(const vpSickLDMRS &sick)
vpSickLDMRS(const vpSickLDMRS &sick)