35 #ifndef NAV_GRID_PUB_SUB_NAV_GRID_MESSAGE_UTILS_H
36 #define NAV_GRID_PUB_SUB_NAV_GRID_MESSAGE_UTILS_H
39 #include <nav_2d_msgs/NavGridOfChars.h>
40 #include <nav_2d_msgs/NavGridOfCharsUpdate.h>
41 #include <nav_2d_msgs/NavGridOfDoubles.h>
42 #include <nav_2d_msgs/NavGridOfDoublesUpdate.h>
58 template<
typename ROSMsgType,
typename NumericType>
68 unsigned int data_index = 0;
71 msg.data[data_index++] = grid(index);
81 template<
typename ROSMsgType,
typename NumericType>
90 unsigned int data_index = 0;
94 update.data[data_index++] = grid(index);
102 template<
typename ROSMsgType,
typename NumericType>
107 if (info != current_info)
112 unsigned int data_index = 0;
115 grid.
setValue(index, msg.data[data_index++]);
122 template<
typename ROSMsgType,
typename NumericType>
128 unsigned int data_index = 0;
142 return toMsg<nav_2d_msgs::NavGridOfChars>(grid, stamp);
150 return toMsg<nav_2d_msgs::NavGridOfDoubles>(grid, stamp);
158 return toMsg<nav_2d_msgs::NavGridOfDoubles>(grid, stamp);
167 return toUpdate<nav_2d_msgs::NavGridOfCharsUpdate>(grid, bounds, stamp);
176 return toUpdate<nav_2d_msgs::NavGridOfDoublesUpdate>(grid, bounds, stamp);
185 return toUpdate<nav_2d_msgs::NavGridOfDoublesUpdate>(grid, bounds, stamp);
191 #endif // NAV_GRID_PUB_SUB_NAV_GRID_MESSAGE_UTILS_H