Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: rosserial_mbed_hello_world_publisher rtos_base_control rosserial_mbed_F64MA ROS-RTOS ... more
JointTrajectory.h
00001 #ifndef _ROS_trajectory_msgs_JointTrajectory_h 00002 #define _ROS_trajectory_msgs_JointTrajectory_h 00003 00004 #include <stdint.h> 00005 #include <string.h> 00006 #include <stdlib.h> 00007 #include "ros/msg.h" 00008 #include "std_msgs/Header.h" 00009 #include "trajectory_msgs/JointTrajectoryPoint.h" 00010 00011 namespace trajectory_msgs 00012 { 00013 00014 class JointTrajectory : public ros::Msg 00015 { 00016 public: 00017 std_msgs::Header header; 00018 uint8_t joint_names_length; 00019 char* st_joint_names; 00020 char* * joint_names; 00021 uint8_t points_length; 00022 trajectory_msgs::JointTrajectoryPoint st_points; 00023 trajectory_msgs::JointTrajectoryPoint * points; 00024 00025 JointTrajectory(): 00026 header(), 00027 joint_names_length(0), joint_names(NULL), 00028 points_length(0), points(NULL) 00029 { 00030 } 00031 00032 virtual int serialize(unsigned char *outbuffer) const 00033 { 00034 int offset = 0; 00035 offset += this->header.serialize(outbuffer + offset); 00036 *(outbuffer + offset++) = joint_names_length; 00037 *(outbuffer + offset++) = 0; 00038 *(outbuffer + offset++) = 0; 00039 *(outbuffer + offset++) = 0; 00040 for( uint8_t i = 0; i < joint_names_length; i++){ 00041 uint32_t length_joint_namesi = strlen(this->joint_names[i]); 00042 memcpy(outbuffer + offset, &length_joint_namesi, sizeof(uint32_t)); 00043 offset += 4; 00044 memcpy(outbuffer + offset, this->joint_names[i], length_joint_namesi); 00045 offset += length_joint_namesi; 00046 } 00047 *(outbuffer + offset++) = points_length; 00048 *(outbuffer + offset++) = 0; 00049 *(outbuffer + offset++) = 0; 00050 *(outbuffer + offset++) = 0; 00051 for( uint8_t i = 0; i < points_length; i++){ 00052 offset += this->points[i].serialize(outbuffer + offset); 00053 } 00054 return offset; 00055 } 00056 00057 virtual int deserialize(unsigned char *inbuffer) 00058 { 00059 int offset = 0; 00060 offset += this->header.deserialize(inbuffer + offset); 00061 uint8_t joint_names_lengthT = *(inbuffer + offset++); 00062 if(joint_names_lengthT > joint_names_length) 00063 this->joint_names = (char**)realloc(this->joint_names, joint_names_lengthT * sizeof(char*)); 00064 offset += 3; 00065 joint_names_length = joint_names_lengthT; 00066 for( uint8_t i = 0; i < joint_names_length; i++){ 00067 uint32_t length_st_joint_names; 00068 memcpy(&length_st_joint_names, (inbuffer + offset), sizeof(uint32_t)); 00069 offset += 4; 00070 for(unsigned int k= offset; k< offset+length_st_joint_names; ++k){ 00071 inbuffer[k-1]=inbuffer[k]; 00072 } 00073 inbuffer[offset+length_st_joint_names-1]=0; 00074 this->st_joint_names = (char *)(inbuffer + offset-1); 00075 offset += length_st_joint_names; 00076 memcpy( &(this->joint_names[i]), &(this->st_joint_names), sizeof(char*)); 00077 } 00078 uint8_t points_lengthT = *(inbuffer + offset++); 00079 if(points_lengthT > points_length) 00080 this->points = (trajectory_msgs::JointTrajectoryPoint*)realloc(this->points, points_lengthT * sizeof(trajectory_msgs::JointTrajectoryPoint)); 00081 offset += 3; 00082 points_length = points_lengthT; 00083 for( uint8_t i = 0; i < points_length; i++){ 00084 offset += this->st_points.deserialize(inbuffer + offset); 00085 memcpy( &(this->points[i]), &(this->st_points), sizeof(trajectory_msgs::JointTrajectoryPoint)); 00086 } 00087 return offset; 00088 } 00089 00090 const char * getType(){ return "trajectory_msgs/JointTrajectory"; }; 00091 const char * getMD5(){ return "65b4f94a94d1ed67169da35a02f33d3f"; }; 00092 00093 }; 00094 00095 } 00096 #endif
Generated on Tue Jul 12 2022 18:39:39 by
1.7.2