diff --git a/src/axis_imu.cc b/src/axis_imu.cc index 9e7f6c286bd9964c6fb809402703535e47d09751..da39f4054d95323e6f1ef64345b10fa025b39e29 100644 --- a/src/axis_imu.cc +++ b/src/axis_imu.cc @@ -117,11 +117,11 @@ private: az = bytesToDouble(58); if (recv_buffer_[0] == 'G') { have_gyro_flag = true; - // ROS_ERROR(" GYRO: %f - %f %f %f", gtime, gx, gy, gz); + ROS_INFO(" GYRO: %f - %f %f %f", gtime, gx, gy, gz); } if (recv_buffer_[33] == 'A') { have_acc_flag = true; - // ROS_ERROR("ACCELEROMETER: %f - %f %f %f", atime, ax, ay, az); + ROS_INFO("ACCELEROMETER: %f - %f %f %f", atime, ax, ay, az); } double ptime = 0.0; @@ -133,7 +133,7 @@ private: ptime = bytesToDouble(67); pan = bytesToDouble(75); tilt = bytesToDouble(83); - ROS_ERROR("POSITION TIME - PAN TILT: %f - %f %f", pan, tilt); + ROS_INFO("POSITION TIME - PAN TILT: %f - %f %f", pan, tilt); } if (!have_gyro_flag) { @@ -277,17 +277,25 @@ int main(int argc, char *argv[]) { // currently fixed rate out so set div to 0 - gyro_div = 0; - accel_div = 0; + gyro_div = 1; + accel_div = 1; std::ostringstream os; + std::ostringstream osstop; + + osstop << "http://" << camera_ip << "/local/motionloggerudp/control.cgi?cmd=stop"; + os << "http://" << camera_ip << "/local/motionloggerudp/control.cgi?cmd=start&target_ip=" << driver_ip << "&target_port=" << port - << "&accel_enabled=1&accel_rate_div=" << accel_div << "&gyro_enabled=1&gyro_rate_div=" << gyro_div << "&pos_enabled=1"; + << "&accel_enabled=1&accel_rate_div=" << accel_div << "&gyro_enabled=1&gyro_rate_div=" << gyro_div << "&pos_enabled=1" + ; + + std::string stopurl = osstop.str(); std::string url = os.str(); + // ROS_INFO("STOPCOMMAND URL: %s", stopurl.c_str()); ROS_INFO("COMMAND URL: %s", url.c_str()); CURL *curl; @@ -313,7 +321,18 @@ int main(int argc, char *argv[]) { } else { ROS_INFO("Curl call succeeded"); } - + +#if 0 + sleep(3); + curl_easy_setopt(curl, CURLOPT_URL, url.c_str()); + /* Check for errors */ + if(res != CURLE_OK) { + fprintf(stderr, "curl_easy_perform() failed: %s\n", + curl_easy_strerror(res)); + } else { + ROS_INFO("Curl call succeeded"); + } +#endif /* always cleanup */ curl_easy_cleanup(curl); } else { @@ -330,6 +349,8 @@ int main(int argc, char *argv[]) { ROS_INFO("runUDPServer"); + //runUDPServer(port); + runUDPServer(port); return 0;