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