Tools/Firmware/DynamixelGateway/Host/DynamixelGateway.cc
//write the servo ids to microcontroller
//make sure to have proper number of servos set
write the servo ids to microcontroller
make sure to have proper number of servos set
write the servo ids to microcontroller make sure to have proper number of servos set
int DynamixelGateway::SetIDs(double * ids)
{
  CHECK_CONNECTION;
  uint8_t cmd[128];
  uint8_t size = 1;
  cmd[0] = ID_MAP_OFFSET;
  uint8_t * cmdPtr = &(cmd[1]);
  for (int ii=0; ii<this->numJoints; ii++)
  {
    if ( (*ids<0) || (*ids>255))
    {
      printf("bad id #%d : %f\n",ii,*ids);
      return -1;
    }
    *cmdPtr++ = (uint8_t)*ids++;
    size++;
  }
  if (this->SendWriteDataAndGetConfirm(cmd, size))
  {
    printf("could not set ids\n");
    return -1;
  }
  return 0;
}
int DynamixelGateway :: SetIDs ( double * ids ) { CHECK_CONNECTION ; uint8_t cmd [ 128 ] ; uint8_t size = 1 ; cmd [ 0 ] = ID_MAP_OFFSET ; uint8_t * cmdPtr = & ( cmd [ 1 ] ) ; for ( int ii = 0 ; ii < this -> numJoints ; ii ++ ) { if ( ( * ids < 0 ) || ( * ids > 255 ) ) { printf ( " \n " , ii , * ids ) ; return -1 ; } * cmdPtr ++ = ( uint8_t ) * ids ++ ; size ++ ; } if ( this -> SendWriteDataAndGetConfirm ( cmd , size ) ) { printf ( " \n " ) ; return -1 ; } return 0 ; }
write the servo ids to microcontroller
make sure to have proper number of servos set
write the servo ids to microcontroller make sure to have proper number of servos set
//check the ids