ld_alternate.c
Go to the documentation of this file.
00001 #include "../csm/csm_all.h"
00002 
00003 int main(int argc, const char ** argv) {
00004         sm_set_program_name(argv[0]);
00005 
00006         int every = 5;
00007         int count = 0;
00008         LDP ld;
00009         while( (ld = ld_read_smart(stdin))) {
00010                 count++;
00011                 
00012                 if(!ld_valid_fields(ld))  {
00013                         sm_error("Invalid laser data (#%d in file)\n", count);
00014                         continue;
00015                 }
00016 
00017                 int i;
00018                 for(i=0;i<ld->nrays;i++) {
00019                         if( (i % every) != 0 ) {
00020                                 ld->valid[i] = 0;
00021                                 ld->readings[i] = NAN;
00022                         }
00023                 }
00024                 
00025                 ld_write_as_json(ld, stdout);
00026                 ld_free(ld);
00027 
00028                 count++;
00029         }
00030         
00031         return 0;
00032 }


csm
Author(s): Andrea Censi
autogenerated on Fri May 17 2019 02:28:33