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 
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_;
59  uint32_t output_stop_timestamp_;
60  uint16_t board_temperature_;
61  uint16_t bridge_temperature_;
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:
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);
94  enum
95  {
96  PRODUCT_CODE = 6805021
97  };
98  enum
99  {
103 
107 
111 
115  };
116 private:
124 };
125 
126 #endif /* ETHERCAT_HARDWARE_WG021_H */
WG021Status::mode_
uint8_t mode_
Definition: wg021.h:75
WG021Command::programmed_current_
int16_t programmed_current_
Definition: wg021.h:76
__attribute__
WG021 __attribute__
WG021::initialize
int initialize(pr2_hardware_interface::HardwareInterface *, bool allow_unprogrammed=true)
Definition: wg021.cpp:114
WG021Status::pad3_
uint32_t pad3_
Definition: wg021.h:86
WG021Status::measured_current_
int16_t measured_current_
Definition: wg021.h:80
WG021::digital_out_B_
pr2_hardware_interface::DigitalOut digital_out_B_
Definition: wg021.h:118
WG021::unpackState
bool unpackState(unsigned char *this_buffer, unsigned char *prev_buffer)
Definition: wg021.cpp:188
WG021Command::digital_out_
uint8_t digital_out_
Definition: wg021.h:73
WG021Status::pad4_
uint16_t pad4_
Definition: wg021.h:87
WG021Status::bridge_temperature_
uint16_t bridge_temperature_
Definition: wg021.h:93
WG021Status::config0_
uint8_t config0_
Definition: wg021.h:82
WG021Status::general_config_
uint8_t general_config_
Definition: wg021.h:77
WG021Status::checksum_
uint8_t checksum_
Definition: wg021.h:98
WG021Command::checksum_
uint8_t checksum_
Definition: wg021.h:82
WG021Status::programmed_current_
int16_t programmed_current_
Definition: wg021.h:79
WG021::PROJECTOR_CONFIG_STATE
@ PROJECTOR_CONFIG_STATE
Definition: wg021.h:112
WG021::PRODUCT_CODE
@ PRODUCT_CODE
Definition: wg021.h:96
WG021::PROJECTOR_CONFIG_ACTION_ON
@ PROJECTOR_CONFIG_ACTION_ON
Definition: wg021.h:105
WG021Status::digital_out_
uint8_t digital_out_
Definition: wg021.h:76
WG021Command::pad1_
uint8_t pad1_
Definition: wg021.h:75
WG021::PROJECTOR_CONFIG_ENABLE_ENABLED
@ PROJECTOR_CONFIG_ENABLE_ENABLED
Definition: wg021.h:101
WG021Command::general_config_
uint8_t general_config_
Definition: wg021.h:74
WG021::digital_out_I_
pr2_hardware_interface::DigitalOut digital_out_I_
Definition: wg021.h:119
pr2_hardware_interface::HardwareInterface
WG021Command::mode_
uint8_t mode_
Definition: wg021.h:72
WG021Status::led_voltage_
int16_t led_voltage_
Definition: wg021.h:95
WG021::construct
void construct(EtherCAT_SlaveHandler *sh, int &start_address)
< Construct EtherCAT device
Definition: wg021.cpp:53
WG021Status::pad1_
uint8_t pad1_
Definition: wg021.h:78
WG021::PROJECTOR_CONFIG_STATE_HIGH
@ PROJECTOR_CONFIG_STATE_HIGH
Definition: wg021.h:113
WG021Command::config1_
uint8_t config1_
Definition: wg021.h:80
WG021::PROJECTOR_CONFIG_ACTION
@ PROJECTOR_CONFIG_ACTION
Definition: wg021.h:104
WG021::projector_
pr2_hardware_interface::Projector projector_
Definition: wg021.h:123
WG021::PROJECTOR_CONFIG_POLARITY
@ PROJECTOR_CONFIG_POLARITY
Definition: wg021.h:108
WG021::PROJECTOR_CONFIG_ACTION_OFF
@ PROJECTOR_CONFIG_ACTION_OFF
Definition: wg021.h:106
WG0X
Definition: wg0x.h:234
WG021Status::supply_voltage_
uint16_t supply_voltage_
Definition: wg021.h:94
WG021Status::output_status_
uint8_t output_status_
Definition: wg021.h:89
WG021::PROJECTOR_CONFIG_ENABLE_DISABLED
@ PROJECTOR_CONFIG_ENABLE_DISABLED
Definition: wg021.h:102
WG021Status::SIZE
static const unsigned SIZE
Definition: wg021.h:99
WG021Status::pad2_
uint8_t pad2_
Definition: wg021.h:85
WG021Status::timestamp_
uint32_t timestamp_
Definition: wg021.h:81
WG021::PROJECTOR_CONFIG_ENABLE
@ PROJECTOR_CONFIG_ENABLE
Definition: wg021.h:100
WG021::digital_out_A_
pr2_hardware_interface::DigitalOut digital_out_A_
Definition: wg021.h:117
WG021::WG021
WG021()
Definition: wg021.h:88
WG021Status::packet_count_
uint16_t packet_count_
Definition: wg021.h:96
WG021::digital_out_M_
pr2_hardware_interface::DigitalOut digital_out_M_
Definition: wg021.h:120
WG021Status::pad_
uint8_t pad_
Definition: wg021.h:97
WG021::PROJECTOR_CONFIG_STATE_LOW
@ PROJECTOR_CONFIG_STATE_LOW
Definition: wg021.h:114
WG021Command::config0_
uint8_t config0_
Definition: wg021.h:79
WG021Status::output_start_timestamp_
uint32_t output_start_timestamp_
Definition: wg021.h:90
WG021Status::pad5_
uint8_t pad5_
Definition: wg021.h:88
wg0x.h
WG021Status::config1_
uint8_t config1_
Definition: wg021.h:83
WG021::diagnostics
void diagnostics(diagnostic_updater::DiagnosticStatusWrapper &d, unsigned char *)
For EtherCAT device that only publish one EtherCAT Status message. If sub-class implements multiDiagn...
Definition: wg021.cpp:242
WG021Status::output_stop_timestamp_
uint32_t output_stop_timestamp_
Definition: wg021.h:91
pr2_hardware_interface::DigitalOut
diagnostic_updater::DiagnosticStatusWrapper
WG021::PROJECTOR_CONFIG_POLARITY_ACTIVE_HIGH
@ PROJECTOR_CONFIG_POLARITY_ACTIVE_HIGH
Definition: wg021.h:109
WG021Command::config2_
uint8_t config2_
Definition: wg021.h:81
pr2_hardware_interface::Projector
WG021::PROJECTOR_CONFIG_POLARITY_ACTIVE_LOW
@ PROJECTOR_CONFIG_POLARITY_ACTIVE_LOW
Definition: wg021.h:110
WG021Command::pad2_
int16_t pad2_
Definition: wg021.h:77
WG021
Definition: wg021.h:85
WG021Status
Definition: wg021.h:41
WG021::packCommand
void packCommand(unsigned char *buffer, bool halt, bool reset)
Definition: wg021.cpp:159
WG021Status::board_temperature_
uint16_t board_temperature_
Definition: wg021.h:92
WG021::digital_out_L0_
pr2_hardware_interface::DigitalOut digital_out_L0_
Definition: wg021.h:121
WG021Status::config2_
uint8_t config2_
Definition: wg021.h:84
WG021::digital_out_L1_
pr2_hardware_interface::DigitalOut digital_out_L1_
Definition: wg021.h:122
WG021Command
Definition: wg021.h:70
WG021Command::pad3_
int32_t pad3_
Definition: wg021.h:78


ethercat_hardware
Author(s): Rob Wheeler , Derek King
autogenerated on Sun Apr 2 2023 02:44:04