Visual Servoing Platform version 3.7.0
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
106class VISP_EXPORT vpSickLDMRS : public vpLaserScanner
107{
108public:
110 {
111 MagicWordC2 = 0xAFFEC0C2
113 };
115 {
116 MeasuredData = 0x2202
118 };
119 vpSickLDMRS();
120
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
151protected:
152#if defined(_WIN32)
153 SOCKET socket_fd;
154#else
156#endif
157 unsigned char *body;
158 vpColVector vAngle; // constant vertical angle for each layer
162};
163END_VISP_NAMESPACE
164#endif
165
166#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:63
Driver for the Sick LD-MRS laser scanner.
bool isFirstMeasure
unsigned char * body
size_t maxlen_body
vpColVector vAngle
double time_offset
vpSickLDMRS(const vpSickLDMRS &sick)
Definition setup.py:1