6 #include <roboorte_robottype.h>
12 struct robottype_orte_data orte;
14 void rcv_hokuyo_scan_cb(const ORTERecvInfo *info, void *vinstance,
15 void *recvCallBackParam)
17 struct hokuyo_scan_type *instance = (struct hokuyo_scan_type *)vinstance;
19 switch (info->status) {
22 for (i = 0; i < HOKUYO_ARRAY_SIZE; i++)
23 printf("%d\n", instance->data[i]);
24 sem_post(&data_printed);
28 fprintf(stderr, "%s: ORTE deadline occurred\n", __FUNCTION__);
35 int main(int argc, char **argv)
38 sem_init(&data_printed, 0, 0);
40 ret = robottype_roboorte_init(&orte);
42 fprintf(stderr, "robottype_roboorte_init failed\n");
45 robottype_subscriber_hokuyo_scan_create(&orte, rcv_hokuyo_scan_cb, &orte);
47 sem_wait(&data_printed);
49 robottype_roboorte_destroy(&orte);