joint_traj_pt_full_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_traj_pt_full_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_traj_pt_full_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->point_))
71  {
72  rtn = true;
73  }
74  else
75  {
76  LOG_ERROR("Failed to unload joint traj pt data");
77  }
78  return rtn;
79 }
80 
82 {
83  this->init();
84  this->point_.copyFrom(point);
85 }
86 
88 {
90  this->point_.init();
91 }
92 
93 
95 {
96  bool rtn = false;
97  LOG_COMM("Executing joint traj. pt. message load");
98  if (buffer->load(this->point_))
99  {
100  rtn = true;
101  }
102  else
103  {
104  rtn = false;
105  LOG_ERROR("Failed to load joint traj. pt data");
106  }
107  return rtn;
108 }
109 
111 {
112  bool rtn = false;
113  LOG_COMM("Executing joint traj pt message unload");
114 
115  if (buffer->unload(this->point_))
116  {
117  rtn = true;
118  }
119  else
120  {
121  rtn = false;
122  LOG_ERROR("Failed to unload joint traj pt data");
123  }
124  return rtn;
125 }
126 
127 } // namespace joint_traj_pt_full_ex_message
128 } // namespace industrial
129 
void setMessageType(int message_type=industrial::simple_message::StandardMsgTypes::INVALID)
Class encapsulated joint trajectory point data. The point data serves as a waypoint along a trajector...
#define LOG_COMM(format,...)
bool load(industrial::shared_types::shared_bool value)
#define LOG_ERROR(format,...)
float data[ROS_MAX_JOINT]
industrial::byte_array::ByteArray & getData()
bool unload(industrial::shared_types::shared_bool &value)
void copyFrom(JointTrajPtFullEx &src)
Copies the passed in value.
void init()
Initializes a empty joint trajectory group.
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