141 bool res=iCanBus->canRead(messageBuffer, messages, &readMessages);
144 for(
int i=0; i<readMessages; i++)
167 if (messageBuffer[i].getId() == 0x12B)
169 sin_frequency[0] = (messageBuffer[i].getData()[1]<<8) | messageBuffer[i].getData()[0];
170 sin_amplitude[0] = (messageBuffer[i].getData()[3]<<8) | messageBuffer[i].getData()[2];
171 dutyCycle[0] = (messageBuffer[i].getData()[5]<<8) | messageBuffer[i].getData()[4];
174 if (messageBuffer[i].getId() == 0x12A)
176 position[0] = (messageBuffer[i].getData()[1]<<8) | messageBuffer[i].getData()[0];
177 speed[0] = (messageBuffer[i].getData()[3]<<8) | messageBuffer[i].getData()[2];
178 pid[0] = (messageBuffer[i].getData()[5]<<8) | messageBuffer[i].getData()[4];
179 torque[0] = (messageBuffer[i].getData()[7]<<8) | messageBuffer[i].getData()[6];
188 if(
log_start)
fprintf(fp,
"%d %d %d %d %d %d %d %d\n",cnt,sin_frequency[0],sin_amplitude[0],position[0],speed[0],pid[0],torque[0],dutyCycle[0]);
190 if ((cnt % 500) == 0)
192 fprintf(stdout,
"%d %d %d %d %d %d %d %d\n",cnt,sin_frequency[0],sin_amplitude[0],position[0],speed[0],pid[0],torque[0],dutyCycle[0]);