PowerCubeCtrlParams.h
Go to the documentation of this file.
1 /*
2  * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9 
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 
18 #ifndef __POWER_CUBE_CTRL_PARAMS_H_
19 #define __POWER_CUBE_CTRL_PARAMS_H_
20 
27 {
28 public:
31  {
32  m_DOF = 0;
33  m_UseMoveVel = true;
34  };
35 
38 
40  int Init(std::string CanModule, std::string CanDevice, int Baudrate, std::vector<int> ModuleIDs)
41  {
42  SetCanModule(CanModule);
43  SetCanDevice(CanDevice);
44  SetBaudrate(Baudrate);
45  SetDOF(ModuleIDs.size());
46  for (int i = 0; i < m_DOF; i++)
47  {
48  m_ModulIDs.push_back(ModuleIDs[i]);
49  }
50  return 0;
51  }
52 
54  void SetDOF(int DOF)
55  {
56  m_DOF = DOF;
57  }
58 
60  int GetDOF()
61  {
62  return m_DOF;
63  }
64 
66  void SetUseMoveVel(bool UseMoveVel)
67  {
68  m_UseMoveVel = UseMoveVel;
69  }
70 
73  {
74  return m_UseMoveVel;
75  }
76 
78  void SetCanModule(std::string CanModule)
79  {
80  m_CanModule = CanModule;
81  }
82 
84  std::string GetCanModule()
85  {
86  return m_CanModule;
87  }
88 
90  void SetCanDevice(std::string CanDevice)
91  {
92  m_CanDevice = CanDevice;
93  }
94 
96  std::string GetCanDevice()
97  {
98  return m_CanDevice;
99  }
100 
102  void SetBaudrate(int Baudrate)
103  {
104  m_Baudrate = Baudrate;
105  }
106 
109  {
110  return m_Baudrate;
111  }
112 
114  std::vector<int> GetModuleIDs()
115  {
116  return m_ModulIDs;
117  }
118 
120  int GetModuleID(int no)
121  {
122  if (no < GetDOF())
123  return m_ModulIDs[no];
124  else
125  return -1;
126  }
127 
129  int SetModuleID(int no, int id)
130  {
131  if (no < GetDOF())
132  {
133  m_ModulIDs[no] = id;
134  return 0;
135  }
136  else
137  return -1;
138  }
139 
141  std::vector<std::string> GetJointNames()
142  {
143  return m_JointNames;
144  }
145 
147  int SetJointNames(std::vector<std::string> JointNames)
148  {
149  if ((int)JointNames.size() == GetDOF())
150  {
151  m_JointNames = JointNames;
152  return 0;
153  }
154  else
155  return -1;
156  }
157  // ToDo: Check the following
158 
160  // Functions for angular constraints: //
162 
164  int SetUpperLimits(std::vector<double> UpperLimits)
165  {
166  if ((int)UpperLimits.size() == GetDOF())
167  {
168  m_UpperLimits = UpperLimits;
169  return 0;
170  }
171  return -1;
172  }
173 
175  int SetLowerLimits(std::vector<double> LowerLimits)
176  {
177  if ((int)LowerLimits.size() == GetDOF())
178  {
179  m_LowerLimits = LowerLimits;
180  return 0;
181  }
182  return -1;
183  }
184 
186  int SetOffsets(std::vector<double> AngleOffsets)
187  {
188  if ((int)AngleOffsets.size() == GetDOF())
189  {
190  m_Offsets = AngleOffsets;
191  return 0;
192  }
193  return -1;
194  }
195 
197  int SetMaxVel(std::vector<double> MaxVel)
198  {
199  if ((int)MaxVel.size() == GetDOF())
200  {
201  m_MaxVel = MaxVel;
202  return 0;
203  }
204  return -1;
205  }
206 
208  int SetMaxAcc(std::vector<double> MaxAcc)
209  {
210  if ((int)MaxAcc.size() == GetDOF())
211  {
212  m_MaxAcc = MaxAcc;
213  return 0;
214  }
215  return -1;
216  }
217 
219  std::vector<double> GetUpperLimits()
220  {
221  return m_UpperLimits;
222  }
223 
225  std::vector<double> GetLowerLimits()
226  {
227  return m_LowerLimits;
228  }
229 
231  std::vector<double> GetOffsets()
232  {
233  return m_Offsets;
234  }
235 
237  std::vector<double> GetMaxAcc()
238  {
239  return m_MaxAcc;
240  }
241 
243  std::vector<double> GetMaxVel()
244  {
245  return m_MaxVel;
246  }
247 
248 private:
249  int m_DOF;
250  std::vector<int> m_ModulIDs;
251  std::vector<std::string> m_JointNames;
252  std::string m_CanModule;
253  std::string m_CanDevice;
256  std::vector<double> m_Offsets;
257  std::vector<double> m_UpperLimits;
258  std::vector<double> m_LowerLimits;
259  std::vector<double> m_MaxVel;
260  std::vector<double> m_MaxAcc;
261 };
262 
263 #endif
void SetCanDevice(std::string CanDevice)
Sets the CAN Device.
std::vector< std::string > GetJointNames()
Gets the joint names.
std::string GetCanModule()
Gets the CAN Module.
int SetLowerLimits(std::vector< double > LowerLimits)
Sets the lower angular limits (rad) for the joints.
std::vector< double > GetLowerLimits()
Gets the lower angular limits (rad) for the joints.
int SetOffsets(std::vector< double > AngleOffsets)
Sets the offset angulars (rad) for the joints.
std::vector< double > m_Offsets
std::vector< double > m_MaxVel
void SetUseMoveVel(bool UseMoveVel)
Sets UseMoveVel.
void SetCanModule(std::string CanModule)
Sets the CAN Module.
int SetJointNames(std::vector< std::string > JointNames)
Sets the joint names.
std::vector< double > GetMaxAcc()
Gets the max. angular accelerations (rad/s^2) for the joints.
~PowerCubeCtrlParams()
Destructor.
std::vector< int > m_ModulIDs
std::vector< std::string > m_JointNames
int SetModuleID(int no, int id)
Sets the Module IDs.
int GetModuleID(int no)
Gets the ModuleID.
std::vector< double > m_LowerLimits
int SetUpperLimits(std::vector< double > UpperLimits)
Sets the upper angular limits (rad) for the joints.
std::string GetCanDevice()
Gets the CAN Device.
int GetDOF()
Gets the DOF value.
int SetMaxAcc(std::vector< double > MaxAcc)
Sets the max. angular accelerations (rad/s^2) for the joints.
int SetMaxVel(std::vector< double > MaxVel)
Sets the max. angular velocities (rad/s) for the joints.
int Init(std::string CanModule, std::string CanDevice, int Baudrate, std::vector< int > ModuleIDs)
Initializing.
std::vector< double > GetOffsets()
Gets the offset angulars (rad) for the joints.
int GetBaudrate()
Gets the Baudrate.
std::vector< double > GetMaxVel()
Gets the max. angular velocities (rad/s) for the joints.
void SetBaudrate(int Baudrate)
Sets the Baudrate.
std::vector< double > GetUpperLimits()
Gets the upper angular limits (rad) for the joints.
PowerCubeCtrlParams()
Constructor.
std::vector< double > m_UpperLimits
int GetUseMoveVel()
Gets UseMoveVel.
void SetDOF(int DOF)
Sets the DOF value.
Parameters for cob_powercube_chain.
std::vector< double > m_MaxAcc
std::vector< int > GetModuleIDs()
Gets the Module IDs.


schunk_powercube_chain
Author(s): Florian Weisshardt
autogenerated on Mon Nov 25 2019 03:48:21