incompatibleUnits(SassUnit a, SassUnit b) : exception() { std::stringstream ss; ss << "Incompatible units: "; ss << "'" << unit_to_string(a) << "' and "; ss << "'" << unit_to_string(b) << "'"; msg = ss.str().c_str(); }
void send_robot_info() { char temp[40]; print_encoder_selections(); strcpy(buff, "\r\nunit = " ); strcat(buff, unit_to_string() ); strcat(buff, "\r\n"); send_message( buff ); sprintf(buff, "Base Frequency = " ); dtostrf( FiveMotorConfigData.base_frequency, 3, 1, temp ); strcat(buff, temp ); strcat(buff, "\r\n"); send_message( buff ); sprintf(buff, "Wheel diameter= " ); dtostrf( FiveMotorConfigData.wheel_diameter, 3, 1, temp ); strcat(buff, temp ); strcat(buff, unit_to_string() ); strcat(buff, "\r\n"); send_message( buff ); sprintf(buff, "Wheel separation= " ); dtostrf( FiveMotorConfigData.wheel_separation, 3, 1, temp ); strcat(buff, temp ); strcat(buff, unit_to_string() ); strcat(buff, "\r\n"); send_message( buff ); sprintf(buff, "Wheel circumference= " ); // calc now b/c may have been stored under different unit. float circumf = FiveMotorConfigData.wheel_diameter * M_PI; dtostrf( circumf, 3, 1, temp ); strcat(buff, temp ); strcat(buff, unit_to_string() ); strcat(buff, "\r\n"); send_message( buff ); // List all unit to counts ratios: for (int m=0; m<5; m++) { sprintf(buff, "\t%c counts_per_unit=%ld %s\r\n", motor_letters[m], FiveMotorConfigData.counts_per_unit[m], unit_to_string() ); send_message( buff ); } // List all motor status': /* sprintf(buff, "Motor Status':\r\n" ); send_message( buff ); for (int m=0; m<5; m++) { sprintf(buff, "\t%c motor_status=%2x \r\n", motor_letters[m], FiveMotorConfigData.motor_status[m] ); send_message( buff ); }*/ // List Limit enable status: send_limit_states(); // Uses the 'v' motor for the gearing. sprintf( buff, "Counts per rev= " ); dtostrf( FiveMotorConfigData.wheel_counts_per_rev, 4, 1, temp ); strcat ( buff,temp ); strcat ( buff, "\r\n"); send_message( buff ); print_pid_parameters(); sprintf(buff, "\r\n"); // need a response to give the prompt again. form_response(buff); }