![](/media/cache/profiles/94aef38441efa3380a3bed3faf1f9d5d.50x50_q85.jpg)
This program is porting rosserial_arduino for mbed http://www.ros.org/wiki/rosserial_arduino This program supported the revision of 169 of rosserial. This program contains an example.
Dependencies: rosserial_mbed_lib mbed Servo
std_msgs/Time.h@3:dff241b66f84, 2011-11-12 (annotated)
- Committer:
- nucho
- Date:
- Sat Nov 12 23:53:04 2011 +0000
- Revision:
- 3:dff241b66f84
- Parent:
- 1:098e75fd5ad2
This program supported the revision of 167 of rosserial.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
nucho | 3:dff241b66f84 | 1 | #ifndef _ROS_std_msgs_Time_h |
nucho | 3:dff241b66f84 | 2 | #define _ROS_std_msgs_Time_h |
nucho | 3:dff241b66f84 | 3 | |
nucho | 3:dff241b66f84 | 4 | #include <stdint.h> |
nucho | 3:dff241b66f84 | 5 | #include <string.h> |
nucho | 3:dff241b66f84 | 6 | #include <stdlib.h> |
nucho | 3:dff241b66f84 | 7 | #include "ros/msg.h" |
nucho | 3:dff241b66f84 | 8 | #include "ros/time.h" |
nucho | 3:dff241b66f84 | 9 | |
nucho | 3:dff241b66f84 | 10 | namespace std_msgs |
nucho | 3:dff241b66f84 | 11 | { |
nucho | 3:dff241b66f84 | 12 | |
nucho | 3:dff241b66f84 | 13 | class Time : public ros::Msg |
nucho | 3:dff241b66f84 | 14 | { |
nucho | 3:dff241b66f84 | 15 | public: |
nucho | 3:dff241b66f84 | 16 | ros::Time data; |
nucho | 3:dff241b66f84 | 17 | |
nucho | 3:dff241b66f84 | 18 | virtual int serialize(unsigned char *outbuffer) const |
nucho | 3:dff241b66f84 | 19 | { |
nucho | 3:dff241b66f84 | 20 | int offset = 0; |
nucho | 3:dff241b66f84 | 21 | *(outbuffer + offset + 0) = (this->data.sec >> (8 * 0)) & 0xFF; |
nucho | 3:dff241b66f84 | 22 | *(outbuffer + offset + 1) = (this->data.sec >> (8 * 1)) & 0xFF; |
nucho | 3:dff241b66f84 | 23 | *(outbuffer + offset + 2) = (this->data.sec >> (8 * 2)) & 0xFF; |
nucho | 3:dff241b66f84 | 24 | *(outbuffer + offset + 3) = (this->data.sec >> (8 * 3)) & 0xFF; |
nucho | 3:dff241b66f84 | 25 | offset += sizeof(this->data.sec); |
nucho | 3:dff241b66f84 | 26 | *(outbuffer + offset + 0) = (this->data.nsec >> (8 * 0)) & 0xFF; |
nucho | 3:dff241b66f84 | 27 | *(outbuffer + offset + 1) = (this->data.nsec >> (8 * 1)) & 0xFF; |
nucho | 3:dff241b66f84 | 28 | *(outbuffer + offset + 2) = (this->data.nsec >> (8 * 2)) & 0xFF; |
nucho | 3:dff241b66f84 | 29 | *(outbuffer + offset + 3) = (this->data.nsec >> (8 * 3)) & 0xFF; |
nucho | 3:dff241b66f84 | 30 | offset += sizeof(this->data.nsec); |
nucho | 3:dff241b66f84 | 31 | return offset; |
nucho | 3:dff241b66f84 | 32 | } |
nucho | 3:dff241b66f84 | 33 | |
nucho | 3:dff241b66f84 | 34 | virtual int deserialize(unsigned char *inbuffer) |
nucho | 3:dff241b66f84 | 35 | { |
nucho | 3:dff241b66f84 | 36 | int offset = 0; |
nucho | 3:dff241b66f84 | 37 | this->data.sec |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
nucho | 3:dff241b66f84 | 38 | this->data.sec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
nucho | 3:dff241b66f84 | 39 | this->data.sec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
nucho | 3:dff241b66f84 | 40 | this->data.sec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
nucho | 3:dff241b66f84 | 41 | offset += sizeof(this->data.sec); |
nucho | 3:dff241b66f84 | 42 | this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 0))) << (8 * 0); |
nucho | 3:dff241b66f84 | 43 | this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 1))) << (8 * 1); |
nucho | 3:dff241b66f84 | 44 | this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 2))) << (8 * 2); |
nucho | 3:dff241b66f84 | 45 | this->data.nsec |= ((uint32_t) (*(inbuffer + offset + 3))) << (8 * 3); |
nucho | 3:dff241b66f84 | 46 | offset += sizeof(this->data.nsec); |
nucho | 3:dff241b66f84 | 47 | return offset; |
nucho | 3:dff241b66f84 | 48 | } |
nucho | 3:dff241b66f84 | 49 | |
nucho | 3:dff241b66f84 | 50 | virtual const char * getType(){ return "std_msgs/Time"; }; |
nucho | 3:dff241b66f84 | 51 | virtual const char * getMD5(){ return "cd7166c74c552c311fbcc2fe5a7bc289"; }; |
nucho | 3:dff241b66f84 | 52 | |
nucho | 3:dff241b66f84 | 53 | }; |
nucho | 3:dff241b66f84 | 54 | |
nucho | 3:dff241b66f84 | 55 | } |
nucho | 0:06fc856e99ca | 56 | #endif |