sr_actuator.hpp
Go to the documentation of this file.
1 /*
2 * Copyright 2011 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 
28 #ifndef _SR_ACTUATOR_HPP_
29 #define _SR_ACTUATOR_HPP_
30 
32 #include <ros_ethercat_model/hardware_interface.hpp>
33 
34 #include <utility>
35 #include <string>
36 #include <vector>
37 
38 namespace sr_actuator
39 {
41 {
42 public:
50  serial_number_low_set(false),
54  serial_number(0),
58  tests_(0),
60  {
61  }
62 
63  // Serial number is composed of a low and a high byte.
64  void set_serial_number_low(unsigned int serial)
65  {
66  serial_number_low = serial;
67  serial_number_low_set = true;
68 
70  {
71  // we received both bytes
73  }
74  };
75 
76  void set_serial_number_high(unsigned int serial)
77  {
78  serial_number_high = serial;
80 
82  {
83  // we received both bytes
85  }
86  };
87 
89  {
91  };
92 
93  double position_unfiltered_;
94 
97 
101 
104  unsigned int serial_number_low;
105  unsigned int serial_number_high;
106  unsigned int serial_number;
107 
108  unsigned int assembly_data_year;
109  unsigned int assembly_data_month;
110  unsigned int assembly_data_day;
111 
112  int tests_;
113  unsigned int can_error_counters;
114 
115  std::vector<int> raw_sensor_values_;
116  std::vector<double> calibrated_sensor_values_;
117 
125  std::vector<std::pair<std::string, bool> > flags_;
126 
127  std::vector<tactiles::AllTactileData> *tactiles_;
128 }; // end class SrActuatorState
129 
131  public SrActuatorState
132 {
133 public:
135  strain_gauge_left_(0),
136  strain_gauge_right_(0),
137  force_unfiltered_(0.0),
138  pwm_(0),
139  motor_gear_ratio(0),
140  force_control_f_(0),
141  force_control_p_(0),
142  force_control_i_(0),
143  force_control_d_(0),
144  force_control_imax_(0),
145  force_control_deadband_(0),
146  force_control_sign_(0),
147  force_control_frequency_(0),
148  temperature_(0.0)
149  {
150  }
151 
154 
156 
157  int pwm_;
158 
159  unsigned int motor_gear_ratio;
160 
169 
173  double temperature_;
174 }; // end class SrMotorActuatorState
175 
177  public SrActuatorState
178 {
179 public:
181  pressure_(),
182  last_commanded_valve_()
183  {
184  }
185 
187  uint16_t pressure_[2];
188  int8_t last_commanded_valve_[2];
189 }; // end class SrMuscleActuatorState
190 
192 {
193 public:
195  valve_()
196  {
197  }
198 
199  int8_t valve_[2];
200 }; // end class SrMuscleActuatorCommand
201 
206  public ros_ethercat_model::Actuator
207 {
208 public:
210 }; // end class SrMotorActuator
211 
216  public ros_ethercat_model::Actuator
217 {
218 public:
221 }; // end class SrMotorActuator
222 } // namespace sr_actuator
223 
224 /* For the emacs weenies in the crowd.
225 Local Variables:
226  c-basic-offset: 2
227 End:
228  */
229 
230 #endif
231 
std::vector< int > raw_sensor_values_
SrMuscleActuatorState muscle_state_
std::vector< std::pair< std::string, bool > > flags_
unsigned int pic_firmware_git_revision_
Definition: sr_actuator.hpp:98
SrMuscleActuatorCommand muscle_command_
std::vector< double > calibrated_sensor_values_
unsigned int server_firmware_git_revision_
Definition: sr_actuator.hpp:99
std::vector< tactiles::AllTactileData > * tactiles_
Contains the different tactile sensors structures.
void set_serial_number_low(unsigned int serial)
Definition: sr_actuator.hpp:64
void set_serial_number_high(unsigned int serial)
Definition: sr_actuator.hpp:76
SrMotorActuatorState motor_state_


sr_hardware_interface
Author(s): Ugo Cupcic
autogenerated on Mon Feb 28 2022 23:52:08