joint_feedback_ex_message.cpp
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2014, Fraunhofer IPA
5  * Author: Thiago de Freitas
6  *
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions are met:
11  *
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the distribution.
17  * * Neither the name of the Fraunhofer IPA, nor the names
18  * of its 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 "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
25  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
26  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
27  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31  * POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 #ifndef FLATHEADERS
40 #else
41 #include "joint_feedback_ex_message.h" // NOLINT(build/include)
42 #include "joint_data.h" // NOLINT(build/include)
43 #include "byte_array.h" // NOLINT(build/include)
44 #include "log_wrapper.h" // NOLINT(build/include)
45 #endif
46 
49 
50 namespace industrial
51 {
52 namespace joint_feedback_ex_message
53 {
54 
56 {
57  this->init();
58 }
59 
61 {
62 }
63 
65 {
66  bool rtn = false;
67  ByteArray data = msg.getData();
68  this->init();
69 
70  if (data.unload(this->data_))
71  {
72  rtn = true;
73  }
74  else
75  {
76  LOG_ERROR("Failed to unload joint feedback message data");
77  }
78  return rtn;
79 }
80 
82 {
83  this->init();
84  this->data_.copyFrom(data);
85 }
86 
88 {
90  this->data_.init();
91 }
92 
94 {
95  bool rtn = false;
96  LOG_COMM("Executing joint feedback message load");
97  if (buffer->load(this->data_))
98  {
99  rtn = true;
100  }
101  else
102  {
103  rtn = false;
104  LOG_ERROR("Failed to load joint feedback message data");
105  }
106  return rtn;
107 }
108 
110 {
111  bool rtn = false;
112  LOG_COMM("Executing joint feedback message unload");
113 
114  if (buffer->unload(this->data_))
115  {
116  rtn = true;
117  }
118  else
119  {
120  rtn = false;
121  LOG_ERROR("Failed to unload joint feedback message data");
122  }
123  return rtn;
124 }
125 
126 } // namespace joint_feedback_ex_message
127 } // namespace industrial
128 
129 
void setMessageType(int message_type=industrial::simple_message::StandardMsgTypes::INVALID)
void init()
Initializes a empty joint feedback ex.
#define LOG_COMM(format,...)
bool load(industrial::shared_types::shared_bool value)
#define LOG_ERROR(format,...)
float data[ROS_MAX_JOINT]
void copyFrom(JointFeedbackEx &src)
Copies the passed in value.
industrial::byte_array::ByteArray & getData()
bool unload(industrial::shared_types::shared_bool &value)
Enumeration of motoman-specific message types. See simple_message.h for a listing of "standard" messa...


motoman_driver
Author(s): Jeremy Zoss (Southwest Research Institute), Ted Miller (MotoROS) (Yaskawa Motoman), Eric Marcil (MotoROS) (Yaskawa Motoman)
autogenerated on Sat May 8 2021 02:27:43