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
104
class
VISP_EXPORT
vpSickLDMRS
:
public
vpLaserScanner
105
{
106
public
:
107
enum
MagicWord
{
108
MagicWordC2 = 0xAFFEC0C2
110
};
111
enum
DataType
{
112
MeasuredData = 0x2202
114
};
115
vpSickLDMRS
();
117
vpSickLDMRS
(
const
vpSickLDMRS
&sick)
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
();
125
vpSickLDMRS
&
operator=
(
const
vpSickLDMRS
&sick)
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
145
protected
:
146
#if defined(_WIN32)
147
SOCKET socket_fd;
148
#else
149
int
socket_fd
;
150
#endif
151
unsigned
char
*
body
;
152
vpColVector
vAngle
;
// constant vertical angle for each layer
153
double
time_offset
;
154
bool
isFirstMeasure
;
155
size_t
maxlen_body
;
156
};
157
158
#endif
159
160
#endif
vpColVector
Implementation of column vector and the associated operations.
Definition
vpColVector.h:167
vpLaserScan
Implements a laser scan data structure that contains especially the list of scanned points that have ...
Definition
vpLaserScan.h:62
vpLaserScanner
Class that defines a generic laser scanner.
Definition
vpLaserScanner.h:55
vpSickLDMRS
Driver for the Sick LD-MRS laser scanner.
Definition
vpSickLDMRS.h:105
vpSickLDMRS::isFirstMeasure
bool isFirstMeasure
Definition
vpSickLDMRS.h:154
vpSickLDMRS::body
unsigned char * body
Definition
vpSickLDMRS.h:151
vpSickLDMRS::socket_fd
int socket_fd
Definition
vpSickLDMRS.h:149
vpSickLDMRS::maxlen_body
size_t maxlen_body
Definition
vpSickLDMRS.h:155
vpSickLDMRS::MagicWord
MagicWord
Definition
vpSickLDMRS.h:107
vpSickLDMRS::vAngle
vpColVector vAngle
Definition
vpSickLDMRS.h:152
vpSickLDMRS::time_offset
double time_offset
Definition
vpSickLDMRS.h:153
vpSickLDMRS::operator=
vpSickLDMRS & operator=(const vpSickLDMRS &sick)
Definition
vpSickLDMRS.h:125
vpSickLDMRS::vpSickLDMRS
vpSickLDMRS(const vpSickLDMRS &sick)
Definition
vpSickLDMRS.h:117
vpSickLDMRS::DataType
DataType
Definition
vpSickLDMRS.h:111
modules
sensor
include
visp3
sensor
vpSickLDMRS.h
Generated by
1.12.0