Just changed OUTPUT_SIZE and INPUT_SIZE in ros/node_handle.h

Dependencies:   BufferedSerial

Dependents:   WRS2020_mecanum_node

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ControllerStatistics.h Source File

ControllerStatistics.h

00001 #ifndef _ROS_controller_manager_msgs_ControllerStatistics_h
00002 #define _ROS_controller_manager_msgs_ControllerStatistics_h
00003 
00004 #include <stdint.h>
00005 #include <string.h>
00006 #include <stdlib.h>
00007 #include "ros/msg.h"
00008 #include "ros/time.h"
00009 #include "ros/duration.h"
00010 
00011 namespace controller_manager_msgs
00012 {
00013 
00014   class ControllerStatistics : public ros::Msg
00015   {
00016     public:
00017       typedef const char* _name_type;
00018       _name_type name;
00019       typedef const char* _type_type;
00020       _type_type type;
00021       typedef ros::Time _timestamp_type;
00022       _timestamp_type timestamp;
00023       typedef bool _running_type;
00024       _running_type running;
00025       typedef ros::Duration _max_time_type;
00026       _max_time_type max_time;
00027       typedef ros::Duration _mean_time_type;
00028       _mean_time_type mean_time;
00029       typedef ros::Duration _variance_time_type;
00030       _variance_time_type variance_time;
00031       typedef int32_t _num_control_loop_overruns_type;
00032       _num_control_loop_overruns_type num_control_loop_overruns;
00033       typedef ros::Time _time_last_control_loop_overrun_type;
00034       _time_last_control_loop_overrun_type time_last_control_loop_overrun;
00035 
00036     ControllerStatistics():
00037       name(""),
00038       type(""),
00039       timestamp(),
00040       running(0),
00041       max_time(),
00042       mean_time(),
00043       variance_time(),
00044       num_control_loop_overruns(0),
00045       time_last_control_loop_overrun()
00046     {
00047     }
00048 
00049     virtual int serialize(unsigned char *outbuffer) const
00050     {
00051       int offset = 0;
00052       uint32_t length_name = strlen(this->name);
00053       varToArr(outbuffer + offset, length_name);
00054       offset += 4;
00055       memcpy(outbuffer + offset, this->name, length_name);
00056       offset += length_name;
00057       uint32_t length_type = strlen(this->type);
00058       varToArr(outbuffer + offset, length_type);
00059       offset += 4;
00060       memcpy(outbuffer + offset, this->type, length_type);
00061       offset += length_type;
00062       *(outbuffer + offset + 0) = (this->timestamp.sec >> (8 * 0)) & 0xFF;
00063       *(outbuffer + offset + 1) = (this->timestamp.sec >> (8 * 1)) & 0xFF;
00064       *(outbuffer + offset + 2) = (this->timestamp.sec >> (8 * 2)) & 0xFF;
00065       *(outbuffer + offset + 3) = (this->timestamp.sec >> (8 * 3)) & 0xFF;
00066       offset += sizeof(this->timestamp.sec);
00067       *(outbuffer + offset + 0) = (this->timestamp.nsec >> (8 * 0)) & 0xFF;
00068       *(outbuffer + offset + 1) = (this->timestamp.nsec >> (8 * 1)) & 0xFF;
00069       *(outbuffer + offset + 2) = (this->timestamp.nsec >> (8 * 2)) & 0xFF;
00070       *(outbuffer + offset + 3) = (this->timestamp.nsec >> (8 * 3)) & 0xFF;
00071       offset += sizeof(this->timestamp.nsec);
00072       union {
00073         bool real;
00074         uint8_t base;
00075       } u_running;
00076       u_running.real = this->running;
00077       *(outbuffer + offset + 0) = (u_running.base >> (8 * 0)) & 0xFF;
00078       offset += sizeof(this->running);
00079       *(outbuffer + offset + 0) = (this->max_time.sec >> (8 * 0)) & 0xFF;
00080       *(outbuffer + offset + 1) = (this->max_time.sec >> (8 * 1)) & 0xFF;
00081       *(outbuffer + offset + 2) = (this->max_time.sec >> (8 * 2)) & 0xFF;
00082       *(outbuffer + offset + 3) = (this->max_time.sec >> (8 * 3)) & 0xFF;
00083       offset += sizeof(this->max_time.sec);
00084       *(outbuffer + offset + 0) = (this->max_time.nsec >> (8 * 0)) & 0xFF;
00085       *(outbuffer + offset + 1) = (this->max_time.nsec >> (8 * 1)) & 0xFF;
00086       *(outbuffer + offset + 2) = (this->max_time.nsec >> (8 * 2)) & 0xFF;
00087       *(outbuffer + offset + 3) = (this->max_time.nsec >> (8 * 3)) & 0xFF;
00088       offset += sizeof(this->max_time.nsec);
00089       *(outbuffer + offset + 0) = (this->mean_time.sec >> (8 * 0)) & 0xFF;
00090       *(outbuffer + offset + 1) = (this->mean_time.sec >> (8 * 1)) & 0xFF;
00091       *(outbuffer + offset + 2) = (this->mean_time.sec >> (8 * 2)) & 0xFF;
00092       *(outbuffer + offset + 3) = (this->mean_time.sec >> (8 * 3)) & 0xFF;
00093       offset += sizeof(this->mean_time.sec);
00094       *(outbuffer + offset + 0) = (this->mean_time.nsec >> (8 * 0)) & 0xFF;
00095       *(outbuffer + offset + 1) = (this->mean_time.nsec >> (8 * 1)) & 0xFF;
00096       *(outbuffer + offset + 2) = (this->mean_time.nsec >> (8 * 2)) & 0xFF;
00097       *(outbuffer + offset + 3) = (this->mean_time.nsec >> (8 * 3)) & 0xFF;
00098       offset += sizeof(this->mean_time.nsec);
00099       *(outbuffer + offset + 0) = (this->variance_time.sec >> (8 * 0)) & 0xFF;
00100       *(outbuffer + offset + 1) = (this->variance_time.sec >> (8 * 1)) & 0xFF;
00101       *(outbuffer + offset + 2) = (this->variance_time.sec >> (8 * 2)) & 0xFF;
00102       *(outbuffer + offset + 3) = (this->variance_time.sec >> (8 * 3)) & 0xFF;
00103       offset += sizeof(this->variance_time.sec);
00104       *(outbuffer + offset + 0) = (this->variance_time.nsec >> (8 * 0)) & 0xFF;
00105       *(outbuffer + offset + 1) = (this->variance_time.nsec >> (8 * 1)) & 0xFF;
00106       *(outbuffer + offset + 2) = (this->variance_time.nsec >> (8 * 2)) & 0xFF;
00107       *(outbuffer + offset + 3) = (this->variance_time.nsec >> (8 * 3)) & 0xFF;
00108       offset += sizeof(this->variance_time.nsec);
00109       union {
00110         int32_t real;
00111         uint32_t base;
00112       } u_num_control_loop_overruns;
00113       u_num_control_loop_overruns.real = this->num_control_loop_overruns;
00114       *(outbuffer + offset + 0) = (u_num_control_loop_overruns.base >> (8 * 0)) & 0xFF;
00115       *(outbuffer + offset + 1) = (u_num_control_loop_overruns.base >> (8 * 1)) & 0xFF;
00116       *(outbuffer + offset + 2) = (u_num_control_loop_overruns.base >> (8 * 2)) & 0xFF;
00117       *(outbuffer + offset + 3) = (u_num_control_loop_overruns.base >> (8 * 3)) & 0xFF;
00118       offset += sizeof(this->num_control_loop_overruns);
00119       *(outbuffer + offset + 0) = (this->time_last_control_loop_overrun.sec >> (8 * 0)) & 0xFF;
00120       *(outbuffer + offset + 1) = (this->time_last_control_loop_overrun.sec >> (8 * 1)) & 0xFF;
00121       *(outbuffer + offset + 2) = (this->time_last_control_loop_overrun.sec >> (8 * 2)) & 0xFF;
00122       *(outbuffer + offset + 3) = (this->time_last_control_loop_overrun.sec >> (8 * 3)) & 0xFF;
00123       offset += sizeof(this->time_last_control_loop_overrun.sec);
00124       *(outbuffer + offset + 0) = (this->time_last_control_loop_overrun.nsec >> (8 * 0)) & 0xFF;
00125       *(outbuffer + offset + 1) = (this->time_last_control_loop_overrun.nsec >> (8 * 1)) & 0xFF;
00126       *(outbuffer + offset + 2) = (this->time_last_control_loop_overrun.nsec >> (8 * 2)) & 0xFF;
00127       *(outbuffer + offset + 3) = (this->time_last_control_loop_overrun.nsec >> (8 * 3)) & 0xFF;
00128       offset += sizeof(this->time_last_control_loop_overrun.nsec);
00129       return offset;
00130     }
00131 
00132     virtual int deserialize(unsigned char *inbuffer)
00133     {
00134       int offset = 0;
00135       uint32_t length_name;
00136       arrToVar(length_name, (inbuffer + offset));
00137       offset += 4;
00138       for(unsigned int k= offset; k< offset+length_name; ++k){
00139           inbuffer[k-1]=inbuffer[k];
00140       }
00141       inbuffer[offset+length_name-1]=0;
00142       this->name = (char *)(inbuffer + offset-1);
00143       offset += length_name;
00144       uint32_t length_type;
00145       arrToVar(length_type, (inbuffer + offset));
00146       offset += 4;
00147       for(unsigned int k= offset; k< offset+length_type; ++k){
00148           inbuffer[k-1]=inbuffer[k];
00149       }
00150       inbuffer[offset+length_type-1]=0;
00151       this->type = (char *)(inbuffer + offset-1);
00152       offset += length_type;
00153       this->timestamp.sec =  ((uint32_t) (*(inbuffer + offset)));
00154       this->timestamp.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00155       this->timestamp.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00156       this->timestamp.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00157       offset += sizeof(this->timestamp.sec);
00158       this->timestamp.nsec =  ((uint32_t) (*(inbuffer + offset)));
00159       this->timestamp.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00160       this->timestamp.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00161       this->timestamp.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00162       offset += sizeof(this->timestamp.nsec);
00163       union {
00164         bool real;
00165         uint8_t base;
00166       } u_running;
00167       u_running.base = 0;
00168       u_running.base |= ((uint8_t) (*(inbuffer + offset + 0))) << (8 * 0);
00169       this->running = u_running.real;
00170       offset += sizeof(this->running);
00171       this->max_time.sec =  ((uint32_t) (*(inbuffer + offset)));
00172       this->max_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00173       this->max_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00174       this->max_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00175       offset += sizeof(this->max_time.sec);
00176       this->max_time.nsec =  ((uint32_t) (*(inbuffer + offset)));
00177       this->max_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00178       this->max_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00179       this->max_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00180       offset += sizeof(this->max_time.nsec);
00181       this->mean_time.sec =  ((uint32_t) (*(inbuffer + offset)));
00182       this->mean_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00183       this->mean_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00184       this->mean_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00185       offset += sizeof(this->mean_time.sec);
00186       this->mean_time.nsec =  ((uint32_t) (*(inbuffer + offset)));
00187       this->mean_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00188       this->mean_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00189       this->mean_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00190       offset += sizeof(this->mean_time.nsec);
00191       this->variance_time.sec =  ((uint32_t) (*(inbuffer + offset)));
00192       this->variance_time.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00193       this->variance_time.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00194       this->variance_time.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00195       offset += sizeof(this->variance_time.sec);
00196       this->variance_time.nsec =  ((uint32_t) (*(inbuffer + offset)));
00197       this->variance_time.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00198       this->variance_time.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00199       this->variance_time.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00200       offset += sizeof(this->variance_time.nsec);
00201       union {
00202         int32_t real;
00203         uint32_t base;
00204       } u_num_control_loop_overruns;
00205       u_num_control_loop_overruns.base = 0;
00206       u_num_control_loop_overruns.base |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0);
00207       u_num_control_loop_overruns.base |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00208       u_num_control_loop_overruns.base |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00209       u_num_control_loop_overruns.base |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00210       this->num_control_loop_overruns = u_num_control_loop_overruns.real;
00211       offset += sizeof(this->num_control_loop_overruns);
00212       this->time_last_control_loop_overrun.sec =  ((uint32_t) (*(inbuffer + offset)));
00213       this->time_last_control_loop_overrun.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00214       this->time_last_control_loop_overrun.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00215       this->time_last_control_loop_overrun.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00216       offset += sizeof(this->time_last_control_loop_overrun.sec);
00217       this->time_last_control_loop_overrun.nsec =  ((uint32_t) (*(inbuffer + offset)));
00218       this->time_last_control_loop_overrun.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1);
00219       this->time_last_control_loop_overrun.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2);
00220       this->time_last_control_loop_overrun.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3);
00221       offset += sizeof(this->time_last_control_loop_overrun.nsec);
00222      return offset;
00223     }
00224 
00225     const char * getType(){ return "controller_manager_msgs/ControllerStatistics"; };
00226     const char * getMD5(){ return "697780c372c8d8597a1436d0e2ad3ba8"; };
00227 
00228   };
00229 
00230 }
00231 #endif