src/experiments/k4/YAPOC/YAPOCControl.cpp
void YAPOCVirtualControl::ReadAxisMap(const char *filename){
      char type;
      FILE *fp = fopen(filename, "r");
      assert (fp != NULL);
      
      //in case of comments
      IgnoreComment(fp);
      //read number of MEI and PIC axes
      fscanf(fp,"%d %d %d\n", &nMEIaxes, &nPICaxes,&numPICdaemons);
      naxes = nMEIaxes + nPICaxes;
      if (DEBUG) printf("Number of MEI axes = %d, Number of PIC axes = %d, Total = %d, Number of PIC daemons = %d\n",
	     nMEIaxes,nPICaxes,naxes,numPICdaemons);
      //in case of comments
      IgnoreComment(fp);
      //for each axis (virtual number 0 - 30), read how it's mapped to actual number
      //and what motor type it is
      for (int i = 0; i < naxes; i++)
	fscanf(fp,"%d %d\n", &axismap[i][AXISTYPE], &axismap[i][AXISNUMBER]);
      fclose(fp);
      
      for (int j = 0; j < naxes; j++)
	if (DEBUG) printf("%d %d\n",axismap[j][AXISTYPE], axismap[j][AXISNUMBER]);
    }
//Read from file mapping between axes virtual to actual number
//file resides in $YARP_ROOT/conf/axismap.ini
Read from file mapping between axes virtual to actual number
file resides in $YARP_ROOT/conf/axismap.ini
Read from file mapping between axes virtual to actual number file resides in $YARP_ROOT / conf / axismap . ini
void YAPOCVirtualControl::ReadAxisMap(const char *filename){
      char type;
      FILE *fp = fopen(filename, "r");
      assert (fp != NULL);
      IgnoreComment(fp);
      fscanf(fp,"%d %d %d\n", &nMEIaxes, &nPICaxes,&numPICdaemons);
      naxes = nMEIaxes + nPICaxes;
      if (DEBUG) printf("Number of MEI axes = %d, Number of PIC axes = %d, Total = %d, Number of PIC daemons = %d\n",
	     nMEIaxes,nPICaxes,naxes,numPICdaemons);
      IgnoreComment(fp);
      for (int i = 0; i < naxes; i++)
	fscanf(fp,"%d %d\n", &axismap[i][AXISTYPE], &axismap[i][AXISNUMBER]);
      fclose(fp);
      for (int j = 0; j < naxes; j++)
	if (DEBUG) printf("%d %d\n",axismap[j][AXISTYPE], axismap[j][AXISNUMBER]);
    }
void YAPOCVirtualControl :: ReadAxisMap ( const char * filename ) { char type ; FILE * fp = fopen ( filename , " " ) ; assert ( fp != NULL ) ; IgnoreComment ( fp ) ; fscanf ( fp , " \n " , & nMEIaxes , & nPICaxes , & numPICdaemons ) ; naxes = nMEIaxes + nPICaxes ; if ( DEBUG ) printf ( " \n " , nMEIaxes , nPICaxes , naxes , numPICdaemons ) ; IgnoreComment ( fp ) ; for ( int i = 0 ; i < naxes ; i ++ ) fscanf ( fp , " \n " , & axismap [ i ] [ AXISTYPE ] , & axismap [ i ] [ AXISNUMBER ] ) ; fclose ( fp ) ; for ( int j = 0 ; j < naxes ; j ++ ) if ( DEBUG ) printf ( " \n " , axismap [ j ] [ AXISTYPE ] , axismap [ j ] [ AXISNUMBER ] ) ; }
Read from file mapping between axes virtual to actual number
file resides in $YARP_ROOT/conf/axismap.ini
Read from file mapping between axes virtual to actual number file resides in $YARP_ROOT / conf / axismap . ini
//in case of comments //read number of MEI and PIC axes //in case of comments //for each axis (virtual number 0 - 30), read how it's mapped to actual number //and what motor type it is