wg021.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2008, Willow Garage, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of the Willow Garage nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *********************************************************************/
34 
35 #ifndef ETHERCAT_HARDWARE_WG021_H
36 #define ETHERCAT_HARDWARE_WG021_H
37 
38 #include <ethercat_hardware/wg0x.h>
39 
40 
42 {
43  uint8_t mode_;
44  uint8_t digital_out_;
45  uint8_t general_config_;
46  uint8_t pad1_;
49  uint32_t timestamp_;
50  uint8_t config0_;
51  uint8_t config1_;
52  uint8_t config2_;
53  uint8_t pad2_;
54  uint32_t pad3_;
55  uint16_t pad4_;
56  uint8_t pad5_;
57  uint8_t output_status_;
62  uint16_t supply_voltage_;
63  int16_t led_voltage_;
64  uint16_t packet_count_;
65  uint8_t pad_;
66  uint8_t checksum_;
67  static const unsigned SIZE=44;
68 }__attribute__ ((__packed__));
69 
71 {
72  uint8_t mode_;
73  uint8_t digital_out_;
74  uint8_t general_config_;
75  uint8_t pad1_;
77  int16_t pad2_;
78  int32_t pad3_;
79  uint8_t config0_;
80  uint8_t config1_;
81  uint8_t config2_;
82  uint8_t checksum_;
83 }__attribute__ ((__packed__));
84 
85 class WG021 : public WG0X
86 {
87 public:
88  WG021() : projector_(digital_out_A_, digital_out_B_, digital_out_I_, digital_out_M_, digital_out_L0_, digital_out_L1_) {}
89  void construct(EtherCAT_SlaveHandler *sh, int &start_address);
90  int initialize(pr2_hardware_interface::HardwareInterface *, bool allow_unprogrammed=true);
91  void packCommand(unsigned char *buffer, bool halt, bool reset);
92  bool unpackState(unsigned char *this_buffer, unsigned char *prev_buffer);
93  void diagnostics(diagnostic_updater::DiagnosticStatusWrapper &d, unsigned char *);
94  enum
95  {
96  PRODUCT_CODE = 6805021
97  };
98  enum
99  {
100  PROJECTOR_CONFIG_ENABLE = 8,
101  PROJECTOR_CONFIG_ENABLE_ENABLED = 8,
102  PROJECTOR_CONFIG_ENABLE_DISABLED = 0,
103 
104  PROJECTOR_CONFIG_ACTION = 4,
105  PROJECTOR_CONFIG_ACTION_ON = 4,
106  PROJECTOR_CONFIG_ACTION_OFF = 0,
107 
108  PROJECTOR_CONFIG_POLARITY = 2,
109  PROJECTOR_CONFIG_POLARITY_ACTIVE_HIGH = 2,
110  PROJECTOR_CONFIG_POLARITY_ACTIVE_LOW = 0,
111 
112  PROJECTOR_CONFIG_STATE = 1,
113  PROJECTOR_CONFIG_STATE_HIGH = 1,
114  PROJECTOR_CONFIG_STATE_LOW = 0
115  };
116 private:
124 };
125 
126 #endif /* ETHERCAT_HARDWARE_WG021_H */
int16_t measured_current_
Definition: wg021.h:48
uint8_t config2_
Definition: wg021.h:52
d
uint32_t pad3_
Definition: wg021.h:54
pr2_hardware_interface::DigitalOut digital_out_L0_
Definition: wg021.h:121
uint8_t config2_
Definition: wg021.h:81
ROSCONSOLE_DECL void initialize()
uint8_t pad_
Definition: wg021.h:65
pr2_hardware_interface::Projector projector_
Definition: wg021.h:123
uint16_t board_temperature_
Definition: wg021.h:60
uint8_t config1_
Definition: wg021.h:51
pr2_hardware_interface::DigitalOut digital_out_B_
Definition: wg021.h:118
pr2_hardware_interface::DigitalOut digital_out_I_
Definition: wg021.h:119
static const unsigned SIZE
Definition: wg021.h:67
int16_t led_voltage_
Definition: wg021.h:63
uint8_t mode_
Definition: wg021.h:43
uint8_t general_config_
Definition: wg021.h:45
uint8_t digital_out_
Definition: wg021.h:44
uint16_t pad4_
Definition: wg021.h:55
uint8_t config0_
Definition: wg021.h:50
Definition: wg021.h:85
uint8_t pad5_
Definition: wg021.h:56
pr2_hardware_interface::DigitalOut digital_out_A_
Definition: wg021.h:117
uint16_t bridge_temperature_
Definition: wg021.h:61
WG021()
Definition: wg021.h:88
uint8_t checksum_
Definition: wg021.h:82
uint8_t output_status_
Definition: wg021.h:57
uint8_t checksum_
Definition: wg021.h:66
uint16_t packet_count_
Definition: wg021.h:64
WG021 __attribute__
int16_t programmed_current_
Definition: wg021.h:47
uint32_t timestamp_
Definition: wg021.h:49
pr2_hardware_interface::DigitalOut digital_out_M_
Definition: wg021.h:120
pr2_hardware_interface::DigitalOut digital_out_L1_
Definition: wg021.h:122
uint16_t supply_voltage_
Definition: wg021.h:62
uint8_t pad1_
Definition: wg021.h:46
uint8_t config1_
Definition: wg021.h:80
Definition: wg0x.h:234
uint8_t pad2_
Definition: wg021.h:53
uint32_t output_start_timestamp_
Definition: wg021.h:58
uint32_t output_stop_timestamp_
Definition: wg021.h:59


ethercat_hardware
Author(s): Rob Wheeler , Derek King
autogenerated on Tue Mar 28 2023 02:10:20