YouBotSlaveMsg.hpp
Go to the documentation of this file.
1 /****************************************************************
2  *
3  * Copyright (c) 2011
4  * All rights reserved.
5  *
6  * Hochschule Bonn-Rhein-Sieg
7  * University of Applied Sciences
8  * Computer Science Department
9  *
10  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
11  *
12  * Author:
13  * Jan Paulus, Nico Hochgeschwender, Michael Reckhaus, Azamat Shakhimardanov
14  * Supervised by:
15  * Gerhard K. Kraetzschmar
16  *
17  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
18  *
19  * This sofware is published under a dual-license: GNU Lesser General Public
20  * License LGPL 2.1 and BSD license. The dual-license implies that users of this
21  * code may choose which terms they prefer.
22  *
23  * +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
24  *
25  * Redistribution and use in source and binary forms, with or without
26  * modification, are permitted provided that the following conditions are met:
27  *
28  * * Redistributions of source code must retain the above copyright
29  * notice, this list of conditions and the following disclaimer.
30  * * Redistributions in binary form must reproduce the above copyright
31  * notice, this list of conditions and the following disclaimer in the
32  * documentation and/or other materials provided with the distribution.
33  * * Neither the name of the Hochschule Bonn-Rhein-Sieg nor the names of its
34  * contributors may be used to endorse or promote products derived from
35  * this software without specific prior written permission.
36  *
37  * This program is free software: you can redistribute it and/or modify
38  * it under the terms of the GNU Lesser General Public License LGPL as
39  * published by the Free Software Foundation, either version 2.1 of the
40  * License, or (at your option) any later version or the BSD license.
41  *
42  * This program is distributed in the hope that it will be useful,
43  * but WITHOUT ANY WARRANTY; without even the implied warranty of
44  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45  * GNU Lesser General Public License LGPL and the BSD license for more details.
46  *
47  * You should have received a copy of the GNU Lesser General Public
48  * License LGPL and BSD license along with this program.
49  *
50  ****************************************************************/
51 
52 #ifndef _YOUBOT_SLAVE_MESSAGE_H
53 #define _YOUBOT_SLAVE_MESSAGE_H
54 
57 #include <string>
58 #include <time.h>
59 
60 namespace youbot {
61 
63 
64  PACKED_BEGIN
68  SlaveMessageOutput():value(0),controllerMode(0) { };
69  } PACKED;
70  PACKED_END
71 
72 
74 
75  PACKED_BEGIN
77  int32 actualPosition; // encoder ticks
79  int32 actualVelocity; // rpm motor axis
85 
87  actualPosition(0),actualCurrent(0),actualVelocity(0),
88  errorFlags(0),targetPosition(0),targetCurrent(0),
89  targetVelocity(0),rampGeneratorVelocity(0) { };
90  } PACKED;
91  PACKED_BEGIN
92 
97  public:
98 
99 
102  unsigned int jointNumber;
103 
104  // Constructor
105 
107  jointNumber = 0;
108  }
109 
110  // Copy-Constructor
111 
113  stctOutput = copy.stctOutput;
114  stctInput = copy.stctInput;
115  jointNumber = copy.jointNumber;
116  }
117 
118  // Destructor
119 
121  }
122 
123  // assignment operator
124 
126  stctOutput = copy.stctOutput;
127  stctInput = copy.stctInput;
128  jointNumber = copy.jointNumber;
129  return *this;
130  }
131  };
132 
137  public:
138 
139 
143 
144  // Constructor
146  jointNumber.Set(0);
147  }
148 
149 
150  // Copy-Constructor
152  SlaveMessageOutput tempOutput;
153  SlaveMessageInput tempInput;
154  unsigned int tempjointNo;
155 
156  copy.stctOutput.Get(tempOutput);
157  stctOutput.Set(tempOutput);
158 
159  copy.stctInput.Get(tempInput);
160  stctInput.Set(tempInput);
161 
162  copy.jointNumber.Get(tempjointNo);
163  jointNumber.Set(tempjointNo);
164  }
165 
166  // Destructor
168  }
169 
170  // assignment operator
172  SlaveMessageOutput tempOutput;
173  SlaveMessageInput tempInput;
174  unsigned int tempjointNo;
175 
176  copy.stctOutput.Get(tempOutput);
177  stctOutput.Set(tempOutput);
178 
179  copy.stctInput.Get(tempInput);
180  stctInput.Set(tempInput);
181 
182  copy.jointNumber.Get(tempjointNo);
183  jointNumber.Set(tempjointNo);
184 
185  return *this;
186  }
187 
188  };
189 
190 } // namespace youbot
191 
192 #endif /* _YOUBOT_SLAVE_MESSAGE_H */
uint8_t uint8
Definition: osal.h:33
PACKED_BEGIN struct youbot::mailboxOutputBuffer PACKED
Output part from the EtherCat message of the youBot EtherCat slaves.
virtual DataType Get() const
General typedefs and defines for EtherCAT.
DataObjectLockFree< SlaveMessageInput > stctInput
This DataObject is a Lock-Free implementation, such that reads and writes can happen concurrently wit...
YouBotSlaveMsg & operator=(const YouBotSlaveMsg &copy)
DataObjectLockFree< SlaveMessageOutput > stctOutput
int32_t int32
Definition: osal.h:32
YouBotSlaveMsgThreadSafe & operator=(const YouBotSlaveMsgThreadSafe &copy)
SlaveMessageInput stctInput
virtual void Set(const DataType &push)
Input part from the EtherCat message of the youBot EtherCat slaves.
YouBotSlaveMsgThreadSafe(const YouBotSlaveMsgThreadSafe &copy)
SlaveMessageOutput stctOutput
uint32_t uint32
Definition: osal.h:35
EtherCat message of the youBot EtherCat slaves which is thread safe.
DataObjectLockFree< unsigned int > jointNumber
EtherCat message of the youBot EtherCat slaves.
YouBotSlaveMsg(const YouBotSlaveMsg &copy)


youbot_driver
Author(s): Jan Paulus
autogenerated on Mon Jun 10 2019 15:46:26