Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
vpQbDevice.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 * Interface for the qb robotics devices.
32 */
33
34#ifndef _vpQbDevice_h_
35#define _vpQbDevice_h_
36
37#include <visp3/core/vpConfig.h>
38#if defined(VISP_HAVE_QBDEVICE) && defined(VISP_HAVE_THREADS)
39
40#include <map>
41#include <memory>
42#include <mutex>
43#include <vector>
44
59class VISP_EXPORT vpQbDevice
60{
61public:
62 vpQbDevice();
63 virtual ~vpQbDevice();
64
66 double getCurrentMax() const;
67 std::vector<short int> getPositionLimits() const;
68 void setMaxRepeats(const int &max_repeats);
70
71protected:
74 virtual int activate(const int &id, const bool &command, const int &max_repeats);
75 virtual int activate(const int &id, const int &max_repeats);
76 virtual bool close(const std::string &serial_port);
77 virtual int deactivate(const int &id, const int &max_repeats);
78
79 virtual int getCurrents(const int &id, const int &max_repeats, std::vector<short int> &currents);
80
81 virtual int getInfo(const int &id, const int &max_repeats, std::string &info);
82 virtual int getMeasurements(const int &id, const int &max_repeats, std::vector<short int> &currents,
83 std::vector<short int> &positions);
84
85 virtual int getParameters(const int &id, std::vector<int> &limits, std::vector<int> &resolutions);
86 virtual int getPositions(const int &id, const int &max_repeats, std::vector<short int> &positions);
87 virtual int getSerialPortsAndDevices(const int &max_repeats);
88
89 virtual bool init(const int &id);
90
91 virtual int isActive(const int &id, const int &max_repeats, bool &status);
92 int isConnected(const int &id, const int &max_repeats);
93 virtual bool isInConnectedSet(const int &id);
94 virtual bool isInOpenMap(const std::string &serial_port);
95 bool isReliable(int const &failures, int const &max_repeats);
96 virtual int open(const std::string &serial_port);
97
98 virtual int setCommandsAndWait(const int &id, const int &max_repeats, std::vector<short int> &commands);
99 virtual int setCommandsAsync(const int &id, std::vector<short int> &commands);
101
102private:
103 vpQbDevice(const vpQbDevice &); // noncopyable
104 vpQbDevice &operator=(const vpQbDevice &); //
105
106 // Implementation
107 class Impl;
108 Impl *m_impl;
109
110protected:
113};
114END_VISP_NAMESPACE
115#endif
116#endif
virtual int deactivate(const int &id, const int &max_repeats)
bool isReliable(int const &failures, int const &max_repeats)
virtual bool isInOpenMap(const std::string &serial_port)
double getCurrentMax() const
virtual int getSerialPortsAndDevices(const int &max_repeats)
virtual bool isInConnectedSet(const int &id)
virtual bool init(const int &id)
int isConnected(const int &id, const int &max_repeats)
int m_max_repeats
Max number of trials to send a command.
Definition vpQbDevice.h:111
virtual int getCurrents(const int &id, const int &max_repeats, std::vector< short int > &currents)
virtual bool close(const std::string &serial_port)
virtual int getMeasurements(const int &id, const int &max_repeats, std::vector< short int > &currents, std::vector< short int > &positions)
virtual int activate(const int &id, const bool &command, const int &max_repeats)
virtual int getParameters(const int &id, std::vector< int > &limits, std::vector< int > &resolutions)
std::vector< short int > getPositionLimits() const
virtual int getPositions(const int &id, const int &max_repeats, std::vector< short int > &positions)
virtual int getInfo(const int &id, const int &max_repeats, std::string &info)
void setMaxRepeats(const int &max_repeats)
virtual int setCommandsAndWait(const int &id, const int &max_repeats, std::vector< short int > &commands)
virtual int setCommandsAsync(const int &id, std::vector< short int > &commands)
virtual int isActive(const int &id, const int &max_repeats, bool &status)
virtual int open(const std::string &serial_port)
bool m_init_done
Flag used to indicate if the device is initialized.
Definition vpQbDevice.h:112