diff options
Diffstat (limited to 'lcmtype/grid_map_t.h')
-rw-r--r-- | lcmtype/grid_map_t.h | 157 |
1 files changed, 157 insertions, 0 deletions
diff --git a/lcmtype/grid_map_t.h b/lcmtype/grid_map_t.h new file mode 100644 index 0000000..7f91b91 --- /dev/null +++ b/lcmtype/grid_map_t.h | |||
@@ -0,0 +1,157 @@ | |||
1 | // THIS IS AN AUTOMATICALLY GENERATED FILE. DO NOT MODIFY | ||
2 | // BY HAND!! | ||
3 | // | ||
4 | // Generated by lcm-gen | ||
5 | |||
6 | // #include <lcm.h> | ||
7 | // #include <lcm_coretypes.h> | ||
8 | #include "lcmtype.h" | ||
9 | #include <stdint.h> | ||
10 | #include <stdlib.h> | ||
11 | |||
12 | |||
13 | #ifndef _grid_map_t_h | ||
14 | #define _grid_map_t_h | ||
15 | |||
16 | #ifdef __cplusplus | ||
17 | extern "C" { | ||
18 | #endif | ||
19 | |||
20 | typedef struct _grid_map_t grid_map_t; | ||
21 | struct _grid_map_t { | ||
22 | int64_t utime; | ||
23 | int8_t encoding; | ||
24 | double x0; | ||
25 | double y0; | ||
26 | double meters_per_pixel; | ||
27 | int32_t width; | ||
28 | int32_t height; | ||
29 | int32_t datalen; | ||
30 | char *src; | ||
31 | uint8_t *dst; | ||
32 | }; | ||
33 | |||
34 | /** | ||
35 | * Create a deep copy of a grid_map_t. | ||
36 | * When no longer needed, destroy it with grid_map_t_destroy() | ||
37 | */ | ||
38 | grid_map_t *grid_map_t_copy(const grid_map_t *to_copy); | ||
39 | |||
40 | /** | ||
41 | * Destroy an instance of grid_map_t created by grid_map_t_copy() | ||
42 | */ | ||
43 | void grid_map_t_destroy(grid_map_t *to_destroy); | ||
44 | |||
45 | /** | ||
46 | * Identifies a single subscription. This is an opaque data type. | ||
47 | */ | ||
48 | typedef struct _grid_map_t_subscription_t grid_map_t_subscription_t; | ||
49 | |||
50 | /** | ||
51 | * Prototype for a callback function invoked when a message of type | ||
52 | * grid_map_t is received. | ||
53 | */ | ||
54 | typedef void (*grid_map_t_handler_t)(const lcm_recv_buf_t *rbuf, | ||
55 | const char *channel, const grid_map_t *msg, | ||
56 | void *userdata); | ||
57 | |||
58 | /** | ||
59 | * Publish a message of type grid_map_t using LCM. | ||
60 | * | ||
61 | * @param lcm The LCM instance to publish with. | ||
62 | * @param channel The channel to publish on. | ||
63 | * @param msg The message to publish. | ||
64 | * @return 0 on success, <0 on error. Success means LCM has transferred | ||
65 | * responsibility of the message data to the OS. | ||
66 | */ | ||
67 | int grid_map_t_publish(lcm_t *lcm, const char *channel, const grid_map_t *msg); | ||
68 | |||
69 | /** | ||
70 | * Subscribe to messages of type grid_map_t using LCM. | ||
71 | * | ||
72 | * @param lcm The LCM instance to subscribe with. | ||
73 | * @param channel The channel to subscribe to. | ||
74 | * @param handler The callback function invoked by LCM when a message is | ||
75 | * received. This function is invoked by LCM during calls to lcm_handle() and | ||
76 | * lcm_handle_timeout(). | ||
77 | * @param userdata An opaque pointer passed to @p handler when it is invoked. | ||
78 | * @return 0 on success, <0 if an error occured | ||
79 | */ | ||
80 | grid_map_t_subscription_t *grid_map_t_subscribe(lcm_t *lcm, const char *channel, | ||
81 | grid_map_t_handler_t handler, | ||
82 | void *userdata); | ||
83 | |||
84 | /** | ||
85 | * Removes and destroys a subscription created by grid_map_t_subscribe() | ||
86 | */ | ||
87 | int grid_map_t_unsubscribe(lcm_t *lcm, grid_map_t_subscription_t *hid); | ||
88 | |||
89 | /** | ||
90 | * Sets the queue capacity for a subscription. | ||
91 | * Some LCM providers (e.g., the default multicast provider) are implemented | ||
92 | * using a background receive thread that constantly revceives messages from | ||
93 | * the network. As these messages are received, they are buffered on | ||
94 | * per-subscription queues until dispatched by lcm_handle(). This function | ||
95 | * how many messages are queued before dropping messages. | ||
96 | * | ||
97 | * @param subs the subscription to modify. | ||
98 | * @param num_messages The maximum number of messages to queue | ||
99 | * on the subscription. | ||
100 | * @return 0 on success, <0 if an error occured | ||
101 | */ | ||
102 | int grid_map_t_subscription_set_queue_capacity(grid_map_t_subscription_t *subs, | ||
103 | int num_messages); | ||
104 | |||
105 | /** | ||
106 | * Encode a message of type grid_map_t into binary form. | ||
107 | * | ||
108 | * @param buf The output buffer. | ||
109 | * @param offset Encoding starts at this byte offset into @p buf. | ||
110 | * @param maxlen Maximum number of bytes to write. This should generally | ||
111 | * be equal to grid_map_t_encoded_size(). | ||
112 | * @param msg The message to encode. | ||
113 | * @return The number of bytes encoded, or <0 if an error occured. | ||
114 | */ | ||
115 | int grid_map_t_encode(void *buf, int offset, int maxlen, const grid_map_t *p); | ||
116 | |||
117 | /** | ||
118 | * Decode a message of type grid_map_t from binary form. | ||
119 | * When decoding messages containing strings or variable-length arrays, this | ||
120 | * function may allocate memory. When finished with the decoded message, | ||
121 | * release allocated resources with grid_map_t_decode_cleanup(). | ||
122 | * | ||
123 | * @param buf The buffer containing the encoded message | ||
124 | * @param offset The byte offset into @p buf where the encoded message starts. | ||
125 | * @param maxlen The maximum number of bytes to read while decoding. | ||
126 | * @param msg Output parameter where the decoded message is stored | ||
127 | * @return The number of bytes decoded, or <0 if an error occured. | ||
128 | */ | ||
129 | int grid_map_t_decode(const void *buf, int offset, int maxlen, grid_map_t *msg); | ||
130 | |||
131 | /** | ||
132 | * Release resources allocated by grid_map_t_decode() | ||
133 | * @return 0 | ||
134 | */ | ||
135 | int grid_map_t_decode_cleanup(grid_map_t *p); | ||
136 | |||
137 | /** | ||
138 | * Check how many bytes are required to encode a message of type grid_map_t | ||
139 | */ | ||
140 | int grid_map_t_encoded_size(const grid_map_t *p); | ||
141 | |||
142 | // LCM support functions. Users should not call these | ||
143 | int64_t __grid_map_t_get_hash(void); | ||
144 | uint64_t __grid_map_t_hash_recursive(const __lcm_hash_ptr *p); | ||
145 | int __grid_map_t_encode_array(void *buf, int offset, int maxlen, | ||
146 | const grid_map_t *p, int elements); | ||
147 | int __grid_map_t_decode_array(const void *buf, int offset, int maxlen, | ||
148 | grid_map_t *p, int elements); | ||
149 | int __grid_map_t_decode_array_cleanup(grid_map_t *p, int elements); | ||
150 | int __grid_map_t_encoded_array_size(const grid_map_t *p, int elements); | ||
151 | int __grid_map_t_clone_array(const grid_map_t *p, grid_map_t *q, int elements); | ||
152 | |||
153 | #ifdef __cplusplus | ||
154 | } | ||
155 | #endif | ||
156 | |||
157 | #endif | ||