io_state.h
Go to the documentation of this file.
1 /*********************************************************************
2 * FSRobo-R Package BSDL
3 * ---------
4 * Copyright (C) 2019 FUJISOFT. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without modification,
7 * are permitted provided that the following conditions are met:
8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice,
11 * this list of conditions and the following disclaimer in the documentation and/or
12 * other materials provided with the distribution.
13 * 3. Neither the name of the copyright holder nor the names of its contributors
14 * may be used to endorse or promote products derived from this software without
15 * specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
21 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *********************************************************************/
28 
29 #ifndef FSROBO_R_DRIVER_SIMPLE_MESSAGE_IO_STATE_H
30 #define FSROBO_R_DRIVER_SIMPLE_MESSAGE_IO_STATE_H
31 
32 #ifndef FLATHEADERS
36 #else
37 #include "simple_message.h"
38 #include "simple_serialize.h"
39 #include "shared_types.h"
40 #endif
41 
42 namespace fsrobo_r_driver
43 {
44 namespace simple_message
45 {
46 namespace io_state
47 {
48 
71 {
72 public:
79 IOState(void);
80 
85 ~IOState(void);
86 
91 void init();
92 
97 //void init(TriState drivesPowered, TriState eStopped, industrial::shared_types::shared_int errorCode, TriState inError,
98 // TriState inMotion, RobotMode mode, TriState motionPossible);
99 
101 {
102  return digital_[idx];
103 }
104 
106 {
107  return analog_[idx];
108 }
109 
111 {
112  this->digital_[idx] = val;
113 }
114 
116 {
117  this->analog_[idx] = val;
118 }
119 
125 void copyFrom(IOState &src);
126 
132 bool operator==(IOState &rhs);
133 
134 // Overrides - SimpleSerialize
137 unsigned int byteLength()
138 {
139  return 3 * sizeof(industrial::shared_types::shared_int);
140 }
141 
142 private:
147 
152 
153 };
154 
155 }
156 }
157 }
158 
159 #endif // FSROBO_R_DRIVER_SIMPLE_MESSAGE_IO_STATE_H
void copyFrom(IOState &src)
Copies the passed in value.
Definition: io_state.cpp:59
industrial::shared_types::shared_int getAnalog(int idx)
Definition: io_state.h:105
industrial::shared_types::shared_int getDigital(int idx)
Initializes a full robot status message.
Definition: io_state.h:100
void init()
Initializes an empty robot status.
Definition: io_state.cpp:52
industrial::shared_types::shared_int digital_[2]
Digital.
Definition: io_state.h:146
bool unload(industrial::byte_array::ByteArray *buffer)
Definition: io_state.cpp:93
Class encapsulated robot status data. The robot status data is meant to mirror the industrial_msgs/Ro...
Definition: io_state.h:70
void setAnalog(int idx, industrial::shared_types::shared_int val)
Definition: io_state.h:115
industrial::shared_types::shared_int analog_[1]
Analog.
Definition: io_state.h:151
void setDigital(int idx, industrial::shared_types::shared_int val)
Definition: io_state.h:110
bool load(industrial::byte_array::ByteArray *buffer)
Definition: io_state.cpp:72
bool operator==(IOState &rhs)
== operator implementation
Definition: io_state.cpp:66


fsrobo_r_driver
Author(s): F-ROSROBO
autogenerated on Sun Feb 9 2020 03:58:29