sr_hand_detector.h
Go to the documentation of this file.
1 /*
2 * Copyright 2020 Shadow Robot Company Ltd.
3 *
4 * This program is free software: you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the Free
6 * Software Foundation version 2 of the License.
7 *
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along
14 * with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16 
17 #ifndef SR_HAND_DETECTOR_SR_HAND_DETECTOR_H
18 #define SR_HAND_DETECTOR_SR_HAND_DETECTOR_H
19 
20 #include <vector>
21 #include <map>
22 #include <string>
23 #include "soem/ethercattype.h"
24 #include "soem/ethercatbase.h"
25 #include "soem/ethercatmain.h"
26 
27 #define MAXBUF 32768
28 
29 namespace sr_hand_detector
30 {
32 {
33  public:
36  void run();
37  std::map<int, std::string> get_hand_serial_to_port();
38 
39  private:
41  void detect_hand_ports();
43  int count_slaves_on_port(std::string);
44  int get_hand_serial(std::string);
45  int read_eeprom(int, int, int);
46 
47  std::map<int, std::string> hand_serial_to_port_map_;
48  std::vector<std::string> available_port_names_;
50  const int SLAVE_WITH_HAND_SERIAL_ = 2;
52 };
53 } // namespace sr_hand_detector
54 
55 #endif // SR_HAND_DETECTOR_SR_HAND_DETECTOR_H
sr_hand_detector::SrHandDetector::available_port_names_
std::vector< std::string > available_port_names_
Definition: sr_hand_detector.h:48
sr_hand_detector::SrHandDetector::NUM_OF_SLAVES_EXPECTED_FOR_HAND_
const int NUM_OF_SLAVES_EXPECTED_FOR_HAND_
Definition: sr_hand_detector.h:51
sr_hand_detector::SrHandDetector
Definition: sr_hand_detector.h:31
sr_hand_detector::SrHandDetector::SrHandDetector
SrHandDetector()
Definition: sr_hand_detector.cpp:29
ethercatmain.h
Headerfile for ethercatmain.c.
sr_hand_detector::SrHandDetector::get_hand_serial
int get_hand_serial(std::string)
Definition: sr_hand_detector.cpp:95
sr_hand_detector::SrHandDetector::get_available_port_names
void get_available_port_names()
Definition: sr_hand_detector.cpp:44
sr_hand_detector::SrHandDetector::get_hands_ports_and_serials
void get_hands_ports_and_serials()
Definition: sr_hand_detector.cpp:69
sr_hand_detector::SrHandDetector::hand_serial_to_port_map_
std::map< int, std::string > hand_serial_to_port_map_
Definition: sr_hand_detector.h:47
uint8
uint8_t uint8
Definition: osal.h:33
ethercatbase.h
Headerfile for ethercatbase.c.
sr_hand_detector
Definition: sr_hand_autodetect.h:27
sr_hand_detector::SrHandDetector::SLAVE_WITH_HAND_SERIAL_
const int SLAVE_WITH_HAND_SERIAL_
Definition: sr_hand_detector.h:50
sr_hand_detector::SrHandDetector::get_hand_serial_to_port
std::map< int, std::string > get_hand_serial_to_port()
Definition: sr_hand_detector.cpp:169
sr_hand_detector::SrHandDetector::~SrHandDetector
~SrHandDetector()
Definition: sr_hand_detector.cpp:34
sr_hand_detector::SrHandDetector::read_eeprom
int read_eeprom(int, int, int)
Definition: sr_hand_detector.cpp:117
sr_hand_detector::SrHandDetector::count_slaves_on_port
int count_slaves_on_port(std::string)
Definition: sr_hand_detector.cpp:81
sr_hand_detector::SrHandDetector::run
void run()
Definition: sr_hand_detector.cpp:38
MAXBUF
#define MAXBUF
Definition: sr_hand_detector.h:27
ethercattype.h
General typedefs and defines for EtherCAT.
sr_hand_detector::SrHandDetector::detect_hand_ports
void detect_hand_ports()
sr_hand_detector::SrHandDetector::ebuf_
uint8 ebuf_[MAXBUF]
Definition: sr_hand_detector.h:49


sr_hand_detector
Author(s):
autogenerated on Sat Sep 24 2022 02:26:10