Source code for panda_gazebo.msg._FollowJointTrajectoryResult

# This Python file uses the following encoding: utf-8
"""autogenerated by genpy from panda_gazebo/FollowJointTrajectoryResult.msg. Do not edit."""
import codecs
import sys
[docs]python3 = True if sys.hexversion > 0x03000000 else False
import genpy import struct
[docs]class FollowJointTrajectoryResult(genpy.Message): _md5sum = "7ede83f5e5f5b797b4656a84d78d8305" _type = "panda_gazebo/FollowJointTrajectoryResult" _has_header = False # flag to mark the presence of a Header object _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ====== int32 error_code int32 SUCCESSFUL = 0 int32 INVALID_GOAL = -1 int32 INVALID_JOINTS = -2 int32 OLD_HEADER_TIMESTAMP = -3 int32 PATH_TOLERANCE_VIOLATED = -4 int32 GOAL_TOLERANCE_VIOLATED = -5 int32 ACTION_TIMEOUT = -6 # Human readable description of the error code. Contains complementary # information that is especially useful when execution fails, for instance: # - INVALID_GOAL: The reason for the invalid goal (e.g., the requested # trajectory is in the past). # - INVALID_JOINTS: The mismatch between the expected controller joints # and those provided in the goal. # - PATH_TOLERANCE_VIOLATED and GOAL_TOLERANCE_VIOLATED: Which joint # violated which tolerance, and by how much. # - ACTION_TIMEOUT: The controller failed to achieve the goal before # the specified timeout elapsed. string error_string """ # Pseudo-constants
[docs] SUCCESSFUL = 0
[docs] INVALID_GOAL = -1
[docs] INVALID_JOINTS = -2
[docs] OLD_HEADER_TIMESTAMP = -3
[docs] PATH_TOLERANCE_VIOLATED = -4
[docs] GOAL_TOLERANCE_VIOLATED = -5
[docs] ACTION_TIMEOUT = -6
__slots__ = ['error_code','error_string'] _slot_types = ['int32','string'] def __init__(self, *args, **kwds): """ Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix in-order arguments and keyword arguments. The available fields are: error_code,error_string :param args: complete set of field values, in .msg order :param kwds: use keyword arguments corresponding to message field names to set specific fields. """ if args or kwds: super(FollowJointTrajectoryResult, self).__init__(*args, **kwds) # message fields cannot be None, assign default values for those that are if self.error_code is None: self.error_code = 0 if self.error_string is None: self.error_string = '' else: self.error_code = 0 self.error_string = '' def _get_types(self): """ internal API method """ return self._slot_types
[docs] def serialize(self, buff): """ serialize message into buffer :param buff: buffer, ``StringIO`` """ try: _x = self.error_code buff.write(_get_struct_i().pack(_x)) _x = self.error_string length = len(_x) if python3 or type(_x) == unicode: _x = _x.encode('utf-8') length = len(_x) buff.write(struct.Struct('<I%ss'%length).pack(length, _x)) except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self))))) except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
[docs] def deserialize(self, str): """ unpack serialized message in str into this message instance :param str: byte array of serialized message, ``str`` """ if python3: codecs.lookup_error("rosmsg").msg_type = self._type try: end = 0 start = end end += 4 (self.error_code,) = _get_struct_i().unpack(str[start:end]) start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.error_string = str[start:end].decode('utf-8', 'rosmsg') else: self.error_string = str[start:end] return self except struct.error as e: raise genpy.DeserializationError(e) # most likely buffer underfill
[docs] def serialize_numpy(self, buff, numpy): """ serialize message with numpy array types into buffer :param buff: buffer, ``StringIO`` :param numpy: numpy python module """ try: _x = self.error_code buff.write(_get_struct_i().pack(_x)) _x = self.error_string length = len(_x) if python3 or type(_x) == unicode: _x = _x.encode('utf-8') length = len(_x) buff.write(struct.Struct('<I%ss'%length).pack(length, _x)) except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self))))) except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
[docs] def deserialize_numpy(self, str, numpy): """ unpack serialized message in str into this message instance using numpy for array types :param str: byte array of serialized message, ``str`` :param numpy: numpy python module """ if python3: codecs.lookup_error("rosmsg").msg_type = self._type try: end = 0 start = end end += 4 (self.error_code,) = _get_struct_i().unpack(str[start:end]) start = end end += 4 (length,) = _struct_I.unpack(str[start:end]) start = end end += length if python3: self.error_string = str[start:end].decode('utf-8', 'rosmsg') else: self.error_string = str[start:end] return self except struct.error as e: raise genpy.DeserializationError(e) # most likely buffer underfill
_struct_I = genpy.struct_I def _get_struct_I(): global _struct_I return _struct_I _struct_i = None def _get_struct_i(): global _struct_i if _struct_i is None: _struct_i = struct.Struct("<i") return _struct_i