joint_traj_pt_full.h
Go to the documentation of this file.
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2013, Southwest Research Institute
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  *
10  * * Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  * * Neither the name of the Southwest Research Institute, nor the names
16  * of its contributors may be used to endorse or promote products derived
17  * from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31 
32 #ifndef JOINT_TRAJ_PT_FULL_H
33 #define JOINT_TRAJ_PT_FULL_H
34 
35 #ifndef FLATHEADERS
40 #else
41 #include "joint_data.h"
42 #include "simple_message.h"
43 #include "simple_serialize.h"
44 #include "shared_types.h"
45 #endif
46 
47 namespace industrial
48 {
49 namespace joint_traj_pt_full
50 {
51 
52 namespace SpecialSeqValues
53 {
55 {
61 };
62 }
64 
65 namespace ValidFieldTypes
66 {
68 {
69  TIME = 0x01, POSITION = 0x02, VELOCITY = 0x04, ACCELERATION = 0x08
70 };
71 }
73 
101 {
102 public:
103 
110  JointTrajPtFull(void);
115  ~JointTrajPtFull(void);
116 
121  void init();
122 
133  industrial::joint_data::JointData & accelerations);
134 
142  {
143  this->robot_id_ = robot_id;
144  }
145 
153  {
154  return this->robot_id_;
155  }
156 
163  {
164  this->sequence_ = sequence;
165  }
166 
173  {
174  return this->sequence_;
175  }
176 
183  {
184  this->time_ = time;
185  this->valid_fields_ |= ValidFieldTypes::TIME; // set the bit
186  }
187 
195  {
196  time = this->time_;
198  }
199 
203  void clearTime()
204  {
205  this->time_ = 0;
206  this->valid_fields_ &= ~ValidFieldTypes::TIME; // clear the bit
207  }
208 
215  {
216  this->positions_.copyFrom(positions);
217  this->valid_fields_ |= ValidFieldTypes::POSITION; // set the bit
218  }
219 
227  {
228  dest.copyFrom(this->positions_);
230  }
231 
236  {
237  this->positions_.init();
238  this->valid_fields_ &= ~ValidFieldTypes::POSITION; // clear the bit
239  }
240 
247  {
248  this->velocities_.copyFrom(velocities);
249  this->valid_fields_ |= ValidFieldTypes::VELOCITY; // set the bit
250  }
251 
259  {
260  dest.copyFrom(this->velocities_);
262  }
263 
268  {
269  this->velocities_.init();
270  this->valid_fields_ &= ~ValidFieldTypes::VELOCITY; // clear the bit
271  }
278  {
279  this->accelerations_.copyFrom(accelerations);
280  this->valid_fields_ |= ValidFieldTypes::ACCELERATION; // set the bit
281  }
282 
290  {
291  dest.copyFrom(this->accelerations_);
293  }
294 
299  {
300  this->accelerations_.init();
301  this->valid_fields_ &= ~ValidFieldTypes::ACCELERATION; // clear the bit
302  }
303 
304 
310  void copyFrom(JointTrajPtFull &src);
311 
317  bool operator==(JointTrajPtFull &rhs);
318 
325  {
326  return valid_fields_ & field;
327  }
328 
329  // Overrides - SimpleSerialize
332  unsigned int byteLength()
333  {
335  + 3*this->positions_.byteLength();
336  }
337 
338 private:
339 
358 
370 
371 };
372 
373 }
374 }
375 
376 #endif /* JOINT_TRAJ_PT_FULL_H */
industrial::joint_traj_pt_full::JointTrajPtFull::byteLength
unsigned int byteLength()
Virtual method returns the object size when packed into a ByteArray.
Definition: joint_traj_pt_full.h:332
industrial::joint_traj_pt_full::SpecialSeqValue
SpecialSeqValues::SpecialSeqValue SpecialSeqValue
Definition: joint_traj_pt_full.h:63
industrial::joint_data::JointData
Class encapsulated joint data (positions, accelerations, velocity, torque, and/or effort).
Definition: joint_data.h:68
industrial::joint_traj_pt_full::JointTrajPtFull::unload
bool unload(industrial::byte_array::ByteArray *buffer)
Virtual method for unloading an object from a ByteArray.
Definition: joint_traj_pt_full.cpp:158
industrial::joint_traj_pt_full::JointTrajPtFull::clearAccelerations
void clearAccelerations()
Clears the acceleration data.
Definition: joint_traj_pt_full.h:298
industrial::joint_traj_pt_full::JointTrajPtFull::sequence_
industrial::shared_types::shared_int sequence_
trajectory sequence number
Definition: joint_traj_pt_full.h:347
industrial::joint_traj_pt_full::JointTrajPtFull::~JointTrajPtFull
~JointTrajPtFull(void)
Destructor.
Definition: joint_traj_pt_full.cpp:53
industrial::joint_traj_pt_full::JointTrajPtFull::positions_
industrial::joint_data::JointData positions_
joint trajectory point positional data
Definition: joint_traj_pt_full.h:362
industrial
Definition: byte_array.h:45
simple_message.h
industrial::joint_traj_pt_full::JointTrajPtFull::getRobotID
industrial::shared_types::shared_int getRobotID()
Gets robot_id. Robot group # (0-based), for controllers with multiple axis-groups.
Definition: joint_traj_pt_full.h:152
industrial::joint_traj_pt_full::JointTrajPtFull::robot_id_
industrial::shared_types::shared_int robot_id_
robot group # (0-based) for controllers that support multiple axis-groups
Definition: joint_traj_pt_full.h:343
industrial::joint_traj_pt_full::JointTrajPtFull::setSequence
void setSequence(industrial::shared_types::shared_int sequence)
Sets joint trajectory point sequence number.
Definition: joint_traj_pt_full.h:162
industrial::joint_traj_pt_full::ValidFieldTypes::TIME
@ TIME
Definition: joint_traj_pt_full.h:69
industrial::joint_traj_pt_full::SpecialSeqValues::SpecialSeqValue
SpecialSeqValue
Definition: joint_traj_pt_full.h:54
industrial::joint_traj_pt_full::SpecialSeqValues::START_TRAJECOTRY_STREAMING
@ START_TRAJECOTRY_STREAMING
deprecated, please use START_TRAJECTORY_STREAMING instead
Definition: joint_traj_pt_full.h:57
industrial::joint_traj_pt_full::JointTrajPtFull::getAccelerations
bool getAccelerations(industrial::joint_data::JointData &dest)
Returns a copy of the acceleration data.
Definition: joint_traj_pt_full.h:289
industrial::joint_traj_pt_full::SpecialSeqValues::STOP_TRAJECTORY
@ STOP_TRAJECTORY
Server should stop the current motion (if any) as soon as possible.
Definition: joint_traj_pt_full.h:60
industrial::joint_traj_pt_full::JointTrajPtFull::getTime
bool getTime(industrial::shared_types::shared_real &time)
Returns joint trajectory point timestamp.
Definition: joint_traj_pt_full.h:194
industrial::joint_traj_pt_full::JointTrajPtFull::setAccelerations
void setAccelerations(industrial::joint_data::JointData &accelerations)
Sets joint acceleration data.
Definition: joint_traj_pt_full.h:277
industrial::joint_traj_pt_full::JointTrajPtFull::init
void init()
Initializes a empty joint trajectory point.
Definition: joint_traj_pt_full.cpp:58
industrial::joint_traj_pt_full::ValidFieldTypes::POSITION
@ POSITION
Definition: joint_traj_pt_full.h:69
industrial::joint_traj_pt_full::JointTrajPtFull::clearPositions
void clearPositions()
Clears the position data.
Definition: joint_traj_pt_full.h:235
industrial::shared_types::shared_real
float shared_real
Definition: shared_types.h:66
industrial::joint_traj_pt_full::JointTrajPtFull::load
bool load(industrial::byte_array::ByteArray *buffer)
Virtual method for loading an object into a ByteArray.
Definition: joint_traj_pt_full.cpp:108
industrial::joint_traj_pt_full::ValidFieldTypes::VELOCITY
@ VELOCITY
Definition: joint_traj_pt_full.h:69
industrial::joint_traj_pt_full::JointTrajPtFull::accelerations_
industrial::joint_data::JointData accelerations_
joint trajectory point acceleration data
Definition: joint_traj_pt_full.h:369
industrial::joint_traj_pt_full::JointTrajPtFull::clearVelocities
void clearVelocities()
Clears the velocity data.
Definition: joint_traj_pt_full.h:267
industrial::joint_traj_pt_full::JointTrajPtFull::setPositions
void setPositions(industrial::joint_data::JointData &positions)
Sets joint position data.
Definition: joint_traj_pt_full.h:214
industrial::joint_traj_pt_full::ValidFieldTypes::ACCELERATION
@ ACCELERATION
Definition: joint_traj_pt_full.h:69
industrial::joint_traj_pt_full::JointTrajPtFull::setVelocities
void setVelocities(industrial::joint_data::JointData &velocities)
Sets joint velocity data.
Definition: joint_traj_pt_full.h:246
industrial::joint_data::JointData::byteLength
unsigned int byteLength()
Virtual method returns the object size when packed into a ByteArray.
Definition: joint_data.h:147
industrial::joint_traj_pt_full::JointTrajPtFull::clearTime
void clearTime()
Clears the joint trajectory point timestamp.
Definition: joint_traj_pt_full.h:203
industrial::byte_array::ByteArray
The byte array wraps a dynamic array of bytes (i.e. char).
Definition: byte_array.h:80
industrial::joint_traj_pt_full::SpecialSeqValues::START_TRAJECTORY_DOWNLOAD
@ START_TRAJECTORY_DOWNLOAD
Downloading drivers only: signal start of trajectory.
Definition: joint_traj_pt_full.h:56
industrial::joint_traj_pt_full::JointTrajPtFull::getPositions
bool getPositions(industrial::joint_data::JointData &dest)
Returns a copy of the position data.
Definition: joint_traj_pt_full.h:226
industrial::joint_data::JointData::init
void init()
Initializes a empty joint data.
Definition: joint_data.cpp:57
industrial::joint_traj_pt_full::JointTrajPtFull
Class encapsulated joint trajectory point data. The point data serves as a waypoint along a trajector...
Definition: joint_traj_pt_full.h:100
shared_types.h
industrial::simple_serialize::SimpleSerialize
Interface for loading and unloading a class to/from a ByteArray.
Definition: simple_serialize.h:52
industrial::joint_traj_pt_full::ValidFieldType
ValidFieldTypes::ValidFieldType ValidFieldType
Definition: joint_traj_pt_full.h:72
industrial::joint_traj_pt_full::JointTrajPtFull::JointTrajPtFull
JointTrajPtFull(void)
Default constructor.
Definition: joint_traj_pt_full.cpp:49
industrial::shared_types::shared_int
int shared_int
Definition: shared_types.h:62
industrial::joint_traj_pt_full::SpecialSeqValues::START_TRAJECTORY_STREAMING
@ START_TRAJECTORY_STREAMING
Streaming drivers only: signal start of trajectory.
Definition: joint_traj_pt_full.h:58
industrial::joint_traj_pt_full::JointTrajPtFull::setTime
void setTime(industrial::shared_types::shared_real time)
Sets joint trajectory point timestamp.
Definition: joint_traj_pt_full.h:182
industrial::joint_traj_pt_full::JointTrajPtFull::valid_fields_
industrial::shared_types::shared_int valid_fields_
bit-mask of (optional) fields that have been initialized with valid data
Definition: joint_traj_pt_full.h:352
industrial::joint_traj_pt_full::JointTrajPtFull::is_valid
bool is_valid(ValidFieldType field)
check the validity state for a given field
Definition: joint_traj_pt_full.h:324
industrial::joint_traj_pt_full::ValidFieldTypes::ValidFieldType
ValidFieldType
Definition: joint_traj_pt_full.h:67
industrial::joint_traj_pt_full::JointTrajPtFull::operator==
bool operator==(JointTrajPtFull &rhs)
== operator implementation
Definition: joint_traj_pt_full.cpp:97
industrial::joint_traj_pt_full::JointTrajPtFull::time_
industrial::shared_types::shared_real time_
joint trajectory point timestamp Typically, time_from_start of this trajectory (in seconds)
Definition: joint_traj_pt_full.h:357
industrial::joint_traj_pt_full::JointTrajPtFull::getVelocities
bool getVelocities(industrial::joint_data::JointData &dest)
Returns a copy of the velocity data.
Definition: joint_traj_pt_full.h:258
joint_data.h
industrial::joint_traj_pt_full::JointTrajPtFull::getSequence
industrial::shared_types::shared_int getSequence()
Returns joint trajectory point sequence number.
Definition: joint_traj_pt_full.h:172
industrial::joint_data::JointData::copyFrom
void copyFrom(JointData &src)
Copies the passed in value.
Definition: joint_data.cpp:107
industrial::joint_traj_pt_full::JointTrajPtFull::setRobotID
void setRobotID(industrial::shared_types::shared_int robot_id)
Sets robot_id. Robot group # (0-based), for controllers with multiple axis-groups.
Definition: joint_traj_pt_full.h:141
industrial::joint_traj_pt_full::JointTrajPtFull::velocities_
industrial::joint_data::JointData velocities_
joint trajectory point velocity data
Definition: joint_traj_pt_full.h:366
industrial::joint_traj_pt_full::JointTrajPtFull::copyFrom
void copyFrom(JointTrajPtFull &src)
Copies the passed in value.
Definition: joint_traj_pt_full.cpp:86
simple_serialize.h
industrial::joint_traj_pt_full::SpecialSeqValues::END_TRAJECTORY
@ END_TRAJECTORY
Downloading drivers only: signal end of trajectory.
Definition: joint_traj_pt_full.h:59


simple_message
Author(s): Shaun Edwards
autogenerated on Wed Mar 2 2022 00:24:53