It has only one change from original one. I added robotfeedback message on it.

Dependencies:   BufferedSerial

Dependents:   RobotFeedback mobileRobotITU

Fork of ros_lib_indigo by Gary Servin

Committer:
randalthor
Date:
Sat Mar 04 14:07:56 2017 +0000
Revision:
4:80d9bee5079a
Parent:
0:fd24f7ca9688
fatih

Who changed what in which revision?

UserRevisionLine numberNew contents of line
garyservin 0:fd24f7ca9688 1 #ifndef _ROS_control_msgs_PointHeadGoal_h
garyservin 0:fd24f7ca9688 2 #define _ROS_control_msgs_PointHeadGoal_h
garyservin 0:fd24f7ca9688 3
garyservin 0:fd24f7ca9688 4 #include <stdint.h>
garyservin 0:fd24f7ca9688 5 #include <string.h>
garyservin 0:fd24f7ca9688 6 #include <stdlib.h>
garyservin 0:fd24f7ca9688 7 #include "ros/msg.h"
garyservin 0:fd24f7ca9688 8 #include "geometry_msgs/PointStamped.h"
garyservin 0:fd24f7ca9688 9 #include "geometry_msgs/Vector3.h"
garyservin 0:fd24f7ca9688 10 #include "ros/duration.h"
garyservin 0:fd24f7ca9688 11
garyservin 0:fd24f7ca9688 12 namespace control_msgs
garyservin 0:fd24f7ca9688 13 {
garyservin 0:fd24f7ca9688 14
garyservin 0:fd24f7ca9688 15 class PointHeadGoal : public ros::Msg
garyservin 0:fd24f7ca9688 16 {
garyservin 0:fd24f7ca9688 17 public:
garyservin 0:fd24f7ca9688 18 geometry_msgs::PointStamped target;
garyservin 0:fd24f7ca9688 19 geometry_msgs::Vector3 pointing_axis;
garyservin 0:fd24f7ca9688 20 const char* pointing_frame;
garyservin 0:fd24f7ca9688 21 ros::Duration min_duration;
garyservin 0:fd24f7ca9688 22 double max_velocity;
garyservin 0:fd24f7ca9688 23
garyservin 0:fd24f7ca9688 24 PointHeadGoal():
garyservin 0:fd24f7ca9688 25 target(),
garyservin 0:fd24f7ca9688 26 pointing_axis(),
garyservin 0:fd24f7ca9688 27 pointing_frame(""),
garyservin 0:fd24f7ca9688 28 min_duration(),
garyservin 0:fd24f7ca9688 29 max_velocity(0)
garyservin 0:fd24f7ca9688 30 {
garyservin 0:fd24f7ca9688 31 }
garyservin 0:fd24f7ca9688 32
garyservin 0:fd24f7ca9688 33 virtual int serialize(unsigned char *outbuffer) const
garyservin 0:fd24f7ca9688 34 {
garyservin 0:fd24f7ca9688 35 int offset = 0;
garyservin 0:fd24f7ca9688 36 offset += this->target.serialize(outbuffer + offset);
garyservin 0:fd24f7ca9688 37 offset += this->pointing_axis.serialize(outbuffer + offset);
garyservin 0:fd24f7ca9688 38 uint32_t length_pointing_frame = strlen(this->pointing_frame);
garyservin 0:fd24f7ca9688 39 memcpy(outbuffer + offset, &length_pointing_frame, sizeof(uint32_t));
garyservin 0:fd24f7ca9688 40 offset += 4;
garyservin 0:fd24f7ca9688 41 memcpy(outbuffer + offset, this->pointing_frame, length_pointing_frame);
garyservin 0:fd24f7ca9688 42 offset += length_pointing_frame;
garyservin 0:fd24f7ca9688 43 *(outbuffer + offset + 0) = (this->min_duration.sec >> (8 * 0)) & 0xFF;
garyservin 0:fd24f7ca9688 44 *(outbuffer + offset + 1) = (this->min_duration.sec >> (8 * 1)) & 0xFF;
garyservin 0:fd24f7ca9688 45 *(outbuffer + offset + 2) = (this->min_duration.sec >> (8 * 2)) & 0xFF;
garyservin 0:fd24f7ca9688 46 *(outbuffer + offset + 3) = (this->min_duration.sec >> (8 * 3)) & 0xFF;
garyservin 0:fd24f7ca9688 47 offset += sizeof(this->min_duration.sec);
garyservin 0:fd24f7ca9688 48 *(outbuffer + offset + 0) = (this->min_duration.nsec >> (8 * 0)) & 0xFF;
garyservin 0:fd24f7ca9688 49 *(outbuffer + offset + 1) = (this->min_duration.nsec >> (8 * 1)) & 0xFF;
garyservin 0:fd24f7ca9688 50 *(outbuffer + offset + 2) = (this->min_duration.nsec >> (8 * 2)) & 0xFF;
garyservin 0:fd24f7ca9688 51 *(outbuffer + offset + 3) = (this->min_duration.nsec >> (8 * 3)) & 0xFF;
garyservin 0:fd24f7ca9688 52 offset += sizeof(this->min_duration.nsec);
garyservin 0:fd24f7ca9688 53 union {
garyservin 0:fd24f7ca9688 54 double real;
garyservin 0:fd24f7ca9688 55 uint64_t base;
garyservin 0:fd24f7ca9688 56 } u_max_velocity;
garyservin 0:fd24f7ca9688 57 u_max_velocity.real = this->max_velocity;
garyservin 0:fd24f7ca9688 58 *(outbuffer + offset + 0) = (u_max_velocity.base >> (8 * 0)) & 0xFF;
garyservin 0:fd24f7ca9688 59 *(outbuffer + offset + 1) = (u_max_velocity.base >> (8 * 1)) & 0xFF;
garyservin 0:fd24f7ca9688 60 *(outbuffer + offset + 2) = (u_max_velocity.base >> (8 * 2)) & 0xFF;
garyservin 0:fd24f7ca9688 61 *(outbuffer + offset + 3) = (u_max_velocity.base >> (8 * 3)) & 0xFF;
garyservin 0:fd24f7ca9688 62 *(outbuffer + offset + 4) = (u_max_velocity.base >> (8 * 4)) & 0xFF;
garyservin 0:fd24f7ca9688 63 *(outbuffer + offset + 5) = (u_max_velocity.base >> (8 * 5)) & 0xFF;
garyservin 0:fd24f7ca9688 64 *(outbuffer + offset + 6) = (u_max_velocity.base >> (8 * 6)) & 0xFF;
garyservin 0:fd24f7ca9688 65 *(outbuffer + offset + 7) = (u_max_velocity.base >> (8 * 7)) & 0xFF;
garyservin 0:fd24f7ca9688 66 offset += sizeof(this->max_velocity);
garyservin 0:fd24f7ca9688 67 return offset;
garyservin 0:fd24f7ca9688 68 }
garyservin 0:fd24f7ca9688 69
garyservin 0:fd24f7ca9688 70 virtual int deserialize(unsigned char *inbuffer)
garyservin 0:fd24f7ca9688 71 {
garyservin 0:fd24f7ca9688 72 int offset = 0;
garyservin 0:fd24f7ca9688 73 offset += this->target.deserialize(inbuffer + offset);
garyservin 0:fd24f7ca9688 74 offset += this->pointing_axis.deserialize(inbuffer + offset);
garyservin 0:fd24f7ca9688 75 uint32_t length_pointing_frame;
garyservin 0:fd24f7ca9688 76 memcpy(&length_pointing_frame, (inbuffer + offset), sizeof(uint32_t));
garyservin 0:fd24f7ca9688 77 offset += 4;
garyservin 0:fd24f7ca9688 78 for(unsigned int k= offset; k< offset+length_pointing_frame; ++k){
garyservin 0:fd24f7ca9688 79 inbuffer[k-1]=inbuffer[k];
garyservin 0:fd24f7ca9688 80 }
garyservin 0:fd24f7ca9688 81 inbuffer[offset+length_pointing_frame-1]=0;
garyservin 0:fd24f7ca9688 82 this->pointing_frame = (char *)(inbuffer + offset-1);
garyservin 0:fd24f7ca9688 83 offset += length_pointing_frame;
garyservin 0:fd24f7ca9688 84 this->min_duration.sec = ((uint32_t) (*(inbuffer + offset)));
garyservin 0:fd24f7ca9688 85 this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:fd24f7ca9688 86 this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:fd24f7ca9688 87 this->min_duration.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:fd24f7ca9688 88 offset += sizeof(this->min_duration.sec);
garyservin 0:fd24f7ca9688 89 this->min_duration.nsec = ((uint32_t) (*(inbuffer + offset)));
garyservin 0:fd24f7ca9688 90 this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:fd24f7ca9688 91 this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:fd24f7ca9688 92 this->min_duration.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:fd24f7ca9688 93 offset += sizeof(this->min_duration.nsec);
garyservin 0:fd24f7ca9688 94 union {
garyservin 0:fd24f7ca9688 95 double real;
garyservin 0:fd24f7ca9688 96 uint64_t base;
garyservin 0:fd24f7ca9688 97 } u_max_velocity;
garyservin 0:fd24f7ca9688 98 u_max_velocity.base = 0;
garyservin 0:fd24f7ca9688 99 u_max_velocity.base |= ((uint64_t) (*(inbuffer + offset + 0))) << (8 * 0);
garyservin 0:fd24f7ca9688 100 u_max_velocity.base |= ((uint64_t) (*(inbuffer + offset + 1))) << (8 * 1);
garyservin 0:fd24f7ca9688 101 u_max_velocity.base |= ((uint64_t) (*(inbuffer + offset + 2))) << (8 * 2);
garyservin 0:fd24f7ca9688 102 u_max_velocity.base |= ((uint64_t) (*(inbuffer + offset + 3))) << (8 * 3);
garyservin 0:fd24f7ca9688 103 u_max_velocity.base |= ((uint64_t) (*(inbuffer + offset + 4))) << (8 * 4);
garyservin 0:fd24f7ca9688 104 u_max_velocity.base |= ((uint64_t) (*(inbuffer + offset + 5))) << (8 * 5);
garyservin 0:fd24f7ca9688 105 u_max_velocity.base |= ((uint64_t) (*(inbuffer + offset + 6))) << (8 * 6);
garyservin 0:fd24f7ca9688 106 u_max_velocity.base |= ((uint64_t) (*(inbuffer + offset + 7))) << (8 * 7);
garyservin 0:fd24f7ca9688 107 this->max_velocity = u_max_velocity.real;
garyservin 0:fd24f7ca9688 108 offset += sizeof(this->max_velocity);
garyservin 0:fd24f7ca9688 109 return offset;
garyservin 0:fd24f7ca9688 110 }
garyservin 0:fd24f7ca9688 111
garyservin 0:fd24f7ca9688 112 const char * getType(){ return "control_msgs/PointHeadGoal"; };
garyservin 0:fd24f7ca9688 113 const char * getMD5(){ return "8b92b1cd5e06c8a94c917dc3209a4c1d"; };
garyservin 0:fd24f7ca9688 114
garyservin 0:fd24f7ca9688 115 };
garyservin 0:fd24f7ca9688 116
garyservin 0:fd24f7ca9688 117 }
garyservin 0:fd24f7ca9688 118 #endif