2 #pragma init (register_roseus_c_util) 16 #define colsize(p) (intval(p->c.ary.dim[1])) 17 #define rowsize(p) (intval(p->c.ary.dim[0])) 18 #define ismatrix(p) ((isarray(p) && \ 19 p->c.ary.rank==makeint(2) && \ 20 elmtypeof(p->c.ary.entity)==ELM_FLOAT)) 21 #define ckvsize(a,b) ((a->c.vec.size==b->c.vec.size)?vecsize(a):(int)error(E_VECINDEX)) 30 int pos_x, pos_y, pos_z;
31 int pos_nx, pos_ny, pos_nz;
61 step = ckintval(argv[1]);
62 size = ckintval(argv[2]);
64 nanflag = ckintval(argv[13]);
66 data = argv[0]->c.str.chars;
67 if (
NIL != argv[3] ) {
68 mat = argv[3]->c.ary.entity->c.fvec.fv;
69 pos_x = ckintval(argv[4]);
70 pos_y = ckintval(argv[5]);
71 pos_z = ckintval(argv[6]);
74 pos_x = pos_y = pos_z = 0;
76 if (
NIL != argv[7] ) {
77 nmat = argv[7]->c.ary.entity->c.fvec.fv;
78 pos_nx = ckintval(argv[8]);
79 pos_ny = ckintval(argv[9]);
80 pos_nz = ckintval(argv[10]);
83 pos_nx = pos_ny = pos_nz = 0;
85 if (
NIL != argv[11] ) {
86 cmat = argv[11]->c.ary.entity->c.fvec.fv;
87 pos_rgb = ckintval(argv[12]);
93 for( i = 0; i < size; i++, data += step ) {
95 *mat++ = ( *((
float *)(data + pos_x)) ) * 1000.0;
96 *mat++ = ( *((
float *)(data + pos_y)) ) * 1000.0;
97 *mat++ = ( *((
float *)(data + pos_z)) ) * 1000.0;
100 *nmat++ = *((
float *)(data + pos_nx));
101 *nmat++ = *((
float *)(data + pos_ny));
102 *nmat++ = *((
float *)(data + pos_nz));
105 int rgb = *((
int *) (data + pos_rgb));
106 *cmat++ = ( ((rgb >> 16) & 0x000000FF) / 255.0 );
107 *cmat++ = ( ((rgb >> 8) & 0x000000FF) / 255.0 );
108 *cmat++ = ( (rgb & 0x000000FF) / 255.0 );
114 if ( mat !=
NULL ) { mat--; }
115 if ( cmat !=
NULL ) { cmat--; }
116 for( i = 0; i < size; i++ ) {
126 if ( cmat !=
NULL ) {
127 if ( isnan(*cmat) ) {
165 size = ckintval(argv[1]);
166 step = ckintval(argv[2]);
168 data = argv[0]->c.str.chars;
170 if (
NIL != argv[3] ) {
171 mat = argv[3]->c.ary.entity->c.fvec.fv;
175 if (
NIL != argv[4] ) {
176 cmat = argv[4]->c.ary.entity->c.fvec.fv;
180 if (
NIL != argv[5] ) {
181 nmat = argv[5]->c.ary.entity->c.fvec.fv;
186 for( i = 0; i < size; i++, data += step ) {
187 float *tmp = (
float *)data;
189 *tmp++ = (*mat++) * 0.001;
190 *tmp++ = (*mat++) * 0.001;
191 *tmp++ = (*mat++) * 0.001;
194 int r = (floor ((*cmat++) * 255));
195 int g = (floor ((*cmat++) * 255));
196 int b = (floor ((*cmat++) * 255));
198 *((
int *)tmp) = ((r & 0x000000FF) << 16) | ((g & 0x000000FF) << 8) | (b & 0x000000FF);
ROS_INFO ROS_ERROR int pointer * argv
pointer CONV_MSG2_PC(context *ctx, int n, argv)
pointer error(enum errorcode ec,...) pointer error(va_alist) va_dcl
pointer ___roseus_c_util()
pointer defun(context *, char *, pointer, pointer(*)(), char *)
pointer CONV_PC_MSG2(context *ctx, int n, argv)