Robot Id change from host name

This commit is contained in:
vivek-shankar 2016-12-23 14:57:57 -05:00
parent 60aa13a4ad
commit c30cc48455
2 changed files with 4 additions and 3 deletions

View File

@ -197,12 +197,12 @@ namespace buzz_utility{
int buzz_script_set(const char* bo_filename,
const char* bdbg_filename, int robot_id) {
//cout<<"bo file name"<<bo_filename;
/* Get hostname */
char hstnm[30];
/* Get hostname */
char hstnm[30];
gethostname(hstnm, 30);
/* Make numeric id from hostname */
/* NOTE: here we assume that the hostname is in the format Knn */
int id = robot_id; //strtol(hstnm + 1, NULL, 10);
int id = strtol(hstnm + 1, NULL, 10); //robot_id;
cout << " Robot ID" << id<< endl;
/* Reset the Buzz VM */
if(VM) buzzvm_destroy(&VM);

View File

@ -99,6 +99,7 @@ neighbors.listen("cmd",
print("Flight status: ",flight.status)
if(flight.rc_cmd!=oldcmd) {
if(flight.rc_cmd==22) {