FollowJointTrajectoryGoal.h
Go to the documentation of this file.
00001 #ifndef _ROS_control_msgs_FollowJointTrajectoryGoal_h
00002 #define _ROS_control_msgs_FollowJointTrajectoryGoal_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "trajectory_msgs/JointTrajectory.h"
00009 #include "control_msgs/JointTolerance.h"
00010 #include "ros/duration.h"
00011 
00012 namespace control_msgs
00013 {
00014 
00015   class FollowJointTrajectoryGoal : public ros::Msg
00016   {
00017     public:
00018       trajectory_msgs::JointTrajectory trajectory;
00019       uint8_t path_tolerance_length;
00020       control_msgs::JointTolerance st_path_tolerance;
00021       control_msgs::JointTolerance * path_tolerance;
00022       uint8_t goal_tolerance_length;
00023       control_msgs::JointTolerance st_goal_tolerance;
00024       control_msgs::JointTolerance * goal_tolerance;
00025       ros::Duration goal_time_tolerance;
00026 
00027     virtual int serialize(unsigned char *outbuffer) const
00028     {
00029       int offset = 0;
00030       offset += this->trajectory.serialize(outbuffer + offset);
00031       *(outbuffer + offset++) = path_tolerance_length;
00032       *(outbuffer + offset++) = 0;
00033       *(outbuffer + offset++) = 0;
00034       *(outbuffer + offset++) = 0;
00035       for( uint8_t i = 0; i < path_tolerance_length; i++){
00036       offset += this->path_tolerance[i].serialize(outbuffer + offset);
00037       }
00038       *(outbuffer + offset++) = goal_tolerance_length;
00039       *(outbuffer + offset++) = 0;
00040       *(outbuffer + offset++) = 0;
00041       *(outbuffer + offset++) = 0;
00042       for( uint8_t i = 0; i < goal_tolerance_length; i++){
00043       offset += this->goal_tolerance[i].serialize(outbuffer + offset);
00044       }
00045       *(outbuffer + offset + 0) = (this->goal_time_tolerance.sec >> (8 * 0)) & 0xFF;
00046       *(outbuffer + offset + 1) = (this->goal_time_tolerance.sec >> (8 * 1)) & 0xFF;
00047       *(outbuffer + offset + 2) = (this->goal_time_tolerance.sec >> (8 * 2)) & 0xFF;
00048       *(outbuffer + offset + 3) = (this->goal_time_tolerance.sec >> (8 * 3)) & 0xFF;
00049       offset += sizeof(this->goal_time_tolerance.sec);
00050       *(outbuffer + offset + 0) = (this->goal_time_tolerance.nsec >> (8 * 0)) & 0xFF;
00051       *(outbuffer + offset + 1) = (this->goal_time_tolerance.nsec >> (8 * 1)) & 0xFF;
00052       *(outbuffer + offset + 2) = (this->goal_time_tolerance.nsec >> (8 * 2)) & 0xFF;
00053       *(outbuffer + offset + 3) = (this->goal_time_tolerance.nsec >> (8 * 3)) & 0xFF;
00054       offset += sizeof(this->goal_time_tolerance.nsec);
00055       return offset;
00056     }
00057 
00058     virtual int deserialize(unsigned char *inbuffer)
00059     {
00060       int offset = 0;
00061       offset += this->trajectory.deserialize(inbuffer + offset);
00062       uint8_t path_tolerance_lengthT = *(inbuffer + offset++);
00063       if(path_tolerance_lengthT > path_tolerance_length)
00064         this->path_tolerance = (control_msgs::JointTolerance*)realloc(this->path_tolerance, path_tolerance_lengthT * sizeof(control_msgs::JointTolerance));
00065       offset += 3;
00066       path_tolerance_length = path_tolerance_lengthT;
00067       for( uint8_t i = 0; i < path_tolerance_length; i++){
00068       offset += this->st_path_tolerance.deserialize(inbuffer + offset);
00069         memcpy( &(this->path_tolerance[i]), &(this->st_path_tolerance), sizeof(control_msgs::JointTolerance));
00070       }
00071       uint8_t goal_tolerance_lengthT = *(inbuffer + offset++);
00072       if(goal_tolerance_lengthT > goal_tolerance_length)
00073         this->goal_tolerance = (control_msgs::JointTolerance*)realloc(this->goal_tolerance, goal_tolerance_lengthT * sizeof(control_msgs::JointTolerance));
00074       offset += 3;
00075       goal_tolerance_length = goal_tolerance_lengthT;
00076       for( uint8_t i = 0; i < goal_tolerance_length; i++){
00077       offset += this->st_goal_tolerance.deserialize(inbuffer + offset);
00078         memcpy( &(this->goal_tolerance[i]), &(this->st_goal_tolerance), sizeof(control_msgs::JointTolerance));
00079       }
00080       this->goal_time_tolerance.sec =  ((uint32_t) (*(inbuffer + offset)));
00081       this->goal_time_tolerance.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00082       this->goal_time_tolerance.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00083       this->goal_time_tolerance.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00084       offset += sizeof(this->goal_time_tolerance.sec);
00085       this->goal_time_tolerance.nsec =  ((uint32_t) (*(inbuffer + offset)));
00086       this->goal_time_tolerance.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00087       this->goal_time_tolerance.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00088       this->goal_time_tolerance.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00089       offset += sizeof(this->goal_time_tolerance.nsec);
00090      return offset;
00091     }
00092 
00093     const char * getType(){ return "control_msgs/FollowJointTrajectoryGoal"; };
00094     const char * getMD5(){ return "69636787b6ecbde4d61d711979bc7ecb"; };
00095 
00096   };
00097 
00098 }
00099 #endif


ric_mc
Author(s): RoboTiCan
autogenerated on Thu Aug 27 2015 14:39:49