From c77c8044cf8c80ff07ea3725eb5c9da493c1f9ff Mon Sep 17 00:00:00 2001 From: David St-Onge Date: Tue, 28 Nov 2017 16:17:28 -0500 Subject: [PATCH] fix var init error on drones and replace ROS_ERROR by ROS_WARN --- src/buzzuav_closures.cpp | 2 +- src/roscontroller.cpp | 18 +++--------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/buzzuav_closures.cpp b/src/buzzuav_closures.cpp index b1aa6c0..295ddde 100644 --- a/src/buzzuav_closures.cpp +++ b/src/buzzuav_closures.cpp @@ -17,7 +17,7 @@ namespace buzzuav_closures{ static double goto_pos[3]; static double rc_goto_pos[3]; static float rc_gimbal[4]; - static float batt[3]; + static float batt[3]={0,0,0}; static float obst[5]={0,0,0,0,0}; static double cur_pos[3]; static uint8_t status; diff --git a/src/roscontroller.cpp b/src/roscontroller.cpp index b03ac07..fad2b10 100644 --- a/src/roscontroller.cpp +++ b/src/roscontroller.cpp @@ -82,7 +82,7 @@ void roscontroller::GetRobotId() while (!xbeestatus_srv.call(robot_id_srv_request, robot_id_srv_response)) { ros::Duration(0.1).sleep(); - ROS_ERROR("Waiting for Xbee to respond to get device ID"); + ROS_WARN("ROSBUZZ is waiting for Xbee device ID"); } robot_id = robot_id_srv_response.value.integer; @@ -256,23 +256,10 @@ void roscontroller::RosControllerRun() /*Set multi message available after update*/ //if (get_update_status()) //{ - /* set_read_update_status(); + set_read_update_status(); multi_msg = true; - log << cur_pos.latitude << "," << cur_pos.longitude << "," - << cur_pos.altitude << ","; - collect_data(log); - map::iterator it = - neighbours_pos_map.begin(); - log << "," << neighbours_pos_map.size(); - for (; it != neighbours_pos_map.end(); ++it) - { - log << "," << (double)it->second.x << "," << (double)it->second.y - << "," << (double)it->second.z; - } - log << std::endl;*/ //} /*Set ROBOTS variable for barrier in .bzz from neighbours count*/ - // no_of_robots=get_number_of_robots(); get_number_of_robots(); buzz_utility::set_robot_var(no_of_robots); /*Retrive the state of the graph and uav and log*/ @@ -300,6 +287,7 @@ void roscontroller::RosControllerRun() timer_step += 1; maintain_pos(timer_step); + // std::cout<< "HOME: " << home.latitude << ", " << home.longitude; } /* Destroy updater and Cleanup */