![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
start to work from here...
Dependencies: MPU6050-DMP mbed ros_lib_kinetic
Fork of AGV_0411 by
tiny_msgs/tinyIMU.h@2:648583d6e41a, 2018-04-12 (annotated)
- Committer:
- WeberYang
- Date:
- Thu Apr 12 01:15:57 2018 +0000
- Revision:
- 2:648583d6e41a
beta1.0 finish Delta servo motor control and IMU-6050
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
WeberYang | 2:648583d6e41a | 1 | #ifndef _ROS_tiny_msgs_tinyIMU_h |
WeberYang | 2:648583d6e41a | 2 | #define _ROS_tiny_msgs_tinyIMU_h |
WeberYang | 2:648583d6e41a | 3 | |
WeberYang | 2:648583d6e41a | 4 | #include <stdint.h> |
WeberYang | 2:648583d6e41a | 5 | #include <string.h> |
WeberYang | 2:648583d6e41a | 6 | #include <stdlib.h> |
WeberYang | 2:648583d6e41a | 7 | #include "ros/msg.h" |
WeberYang | 2:648583d6e41a | 8 | #include "std_msgs/Header.h" |
WeberYang | 2:648583d6e41a | 9 | #include "tinyVector.h" |
WeberYang | 2:648583d6e41a | 10 | |
WeberYang | 2:648583d6e41a | 11 | namespace tiny_msgs |
WeberYang | 2:648583d6e41a | 12 | { |
WeberYang | 2:648583d6e41a | 13 | |
WeberYang | 2:648583d6e41a | 14 | class tinyIMU : public ros::Msg |
WeberYang | 2:648583d6e41a | 15 | { |
WeberYang | 2:648583d6e41a | 16 | public: |
WeberYang | 2:648583d6e41a | 17 | typedef std_msgs::Header _header_type; |
WeberYang | 2:648583d6e41a | 18 | _header_type header; |
WeberYang | 2:648583d6e41a | 19 | typedef tiny_msgs::tinyVector _accel_type; |
WeberYang | 2:648583d6e41a | 20 | _accel_type accel; |
WeberYang | 2:648583d6e41a | 21 | typedef tiny_msgs::tinyVector _gyro_type; |
WeberYang | 2:648583d6e41a | 22 | _gyro_type gyro; |
WeberYang | 2:648583d6e41a | 23 | |
WeberYang | 2:648583d6e41a | 24 | tinyIMU(): |
WeberYang | 2:648583d6e41a | 25 | header(), |
WeberYang | 2:648583d6e41a | 26 | accel(), |
WeberYang | 2:648583d6e41a | 27 | gyro() |
WeberYang | 2:648583d6e41a | 28 | { |
WeberYang | 2:648583d6e41a | 29 | } |
WeberYang | 2:648583d6e41a | 30 | |
WeberYang | 2:648583d6e41a | 31 | virtual int serialize(unsigned char *outbuffer) const |
WeberYang | 2:648583d6e41a | 32 | { |
WeberYang | 2:648583d6e41a | 33 | int offset = 0; |
WeberYang | 2:648583d6e41a | 34 | offset += this->header.serialize(outbuffer + offset); |
WeberYang | 2:648583d6e41a | 35 | offset += this->accel.serialize(outbuffer + offset); |
WeberYang | 2:648583d6e41a | 36 | offset += this->gyro.serialize(outbuffer + offset); |
WeberYang | 2:648583d6e41a | 37 | return offset; |
WeberYang | 2:648583d6e41a | 38 | } |
WeberYang | 2:648583d6e41a | 39 | |
WeberYang | 2:648583d6e41a | 40 | virtual int deserialize(unsigned char *inbuffer) |
WeberYang | 2:648583d6e41a | 41 | { |
WeberYang | 2:648583d6e41a | 42 | int offset = 0; |
WeberYang | 2:648583d6e41a | 43 | offset += this->header.deserialize(inbuffer + offset); |
WeberYang | 2:648583d6e41a | 44 | offset += this->accel.deserialize(inbuffer + offset); |
WeberYang | 2:648583d6e41a | 45 | offset += this->gyro.deserialize(inbuffer + offset); |
WeberYang | 2:648583d6e41a | 46 | return offset; |
WeberYang | 2:648583d6e41a | 47 | } |
WeberYang | 2:648583d6e41a | 48 | |
WeberYang | 2:648583d6e41a | 49 | const char * getType(){ return "tiny_msgs/tinyIMU"; }; |
WeberYang | 2:648583d6e41a | 50 | const char * getMD5(){ return "53582bc8b7315f3bc7728d82df98bb24"; }; |
WeberYang | 2:648583d6e41a | 51 | |
WeberYang | 2:648583d6e41a | 52 | }; |
WeberYang | 2:648583d6e41a | 53 | |
WeberYang | 2:648583d6e41a | 54 | } |
WeberYang | 2:648583d6e41a | 55 | #endif |