44             arv_stream_set_emit_signals(
p_streams_[i], FALSE);
 
   74         guint64 n_completed_buffers = 0;
 
   75         guint64 n_failures          = 0;
 
   76         guint64 n_underruns         = 0;
 
   77         arv_stream_get_statistics(
p_streams_[i], &n_completed_buffers, &n_failures, &n_underruns);
 
   78         ROS_INFO(
"Completed buffers = %Lu", (
unsigned long long)n_completed_buffers);
 
   79         ROS_INFO(
"Failures          = %Lu", (
unsigned long long)n_failures);
 
   80         ROS_INFO(
"Underruns         = %Lu", (
unsigned long long)n_underruns);
 
   85             arv_gv_stream_get_statistics(
reinterpret_cast<ArvGvStream*
>(
p_streams_[i]), &n_resent, &n_missing);
 
   86             ROS_INFO(
"Resent buffers    = %Lu", (
unsigned long long)n_resent);
 
   87             ROS_INFO(
"Missing           = %Lu", (
unsigned long long)n_missing);
 
   93         arv_device_execute_command(
p_device_, 
"AcquisitionStop");
 
  117     bool init_params_from_reconfig = pnh.
param<
bool>(
"init_params_from_dyn_reconfigure", 
true);
 
  119     std::string awb_mode                  = pnh.
param<std::string>(
"BalanceWhiteAuto", 
"Continuous");
 
  120     std::string wb_ratio_selector_feature = pnh.
param<std::string>(
"wb_ratio_selector_feature", 
"");
 
  121     std::string wb_ratio_feature          = pnh.
param<std::string>(
"wb_ratio_feature", 
"");
 
  123     std::string wb_ratio_selector_args = pnh.
param<std::string>(
"wb_ratio_selectors", 
"");
 
  124     std::vector<std::string> wb_ratio_selector_values;
 
  127     std::string wb_ratio_args = pnh.
param<std::string>(
"wb_ratios", 
"");
 
  128     std::vector<std::string> wb_ratio_str_values;
 
  131     if (wb_ratio_selector_values.size() != wb_ratio_str_values.size())
 
  133         ROS_WARN(
"Lists of 'wb_ratio_selector' and 'wb_ratio' have different sizes. " 
  134                  "Only setting values which exist in both lists.");
 
  140     std::string stream_channel_args;
 
  141     if (pnh.
getParam(
"channel_names", stream_channel_args))
 
  150     std::string pixel_format_args;
 
  151     std::vector<std::string> pixel_formats;
 
  152     pnh.
param(
"PixelFormat", pixel_format_args, pixel_format_args);
 
  155     std::string calib_url_args;
 
  156     std::vector<std::string> calib_urls;
 
  157     pnh.
param(
"camera_info_url", calib_url_args, calib_url_args);
 
  162       std::max(0.0, pnh.
param<
double>(
"diagnostic_publish_rate", 0.1));
 
  170     arv_update_device_list();
 
  171     uint n_interfaces = arv_get_n_interfaces();
 
  172     ROS_INFO(
"# Interfaces: %d", n_interfaces);
 
  174     uint n_devices = arv_get_n_devices();
 
  175     ROS_INFO(
"# Devices: %d", n_devices);
 
  176     for (uint i = 0; i < n_devices; i++)
 
  177         ROS_INFO(
"Device%d: %s", i, arv_get_device_id(i));
 
  202     const char* vendor_name = arv_camera_get_vendor_name(
p_camera_);
 
  203     const char* model_name  = arv_camera_get_model_name(
p_camera_);
 
  204     const char* device_id   = arv_camera_get_device_id(
p_camera_);
 
  205     const char* device_sn   = arv_device_get_string_feature_value(
p_device_, 
"DeviceSerialNumber");
 
  206     ROS_INFO(
"Successfully Opened: %s-%s-%s", vendor_name, model_name,
 
  207              (device_sn) ? device_sn : device_id);
 
  228         ROS_WARN(
"Unable to detect number of supported stream channels.");
 
  258         arv_camera_gv_select_stream_channel(
p_camera_, i);
 
  266         gint64 focus_min64, focus_max64;
 
  267         arv_device_get_integer_feature_bounds(
p_device_, 
"FocusPos", &focus_min64, &focus_max64);
 
  279         arv_camera_gv_select_stream_channel(
p_camera_, i);
 
  281         if (init_params_from_reconfig)
 
  287                 arv_device_set_float_feature_value(
p_device_, 
"ExposureTimeAbs", 
config_.ExposureTime);
 
  291                 arv_device_set_integer_feature_value(
p_device_, 
"AcquisitionFrameRateEnable", 1);
 
  301                 arv_device_set_string_feature_value(
p_device_, 
"TriggerSelector", 
"FrameStart");
 
  302                 arv_device_set_string_feature_value(
p_device_, 
"TriggerMode", 
"Off");
 
  311             for (
int l = 0; l < std::min(wb_ratio_selector_values.size(), wb_ratio_str_values.size());
 
  314                 arv_device_set_string_feature_value(
p_device_, wb_ratio_selector_feature.c_str(),
 
  315                                                     wb_ratio_selector_values[l].c_str());
 
  316                 arv_device_set_float_feature_value(
p_device_, wb_ratio_feature.c_str(),
 
  317                                                    std::stof(wb_ratio_str_values[l]));
 
  344         arv_camera_gv_select_stream_channel(
p_camera_, i);
 
  345         std::string source_selector = 
"Source" + std::to_string(i);
 
  346         arv_device_set_string_feature_value(
p_device_, 
"SourceSelector", source_selector.c_str());
 
  347         arv_device_set_string_feature_value(
p_device_, 
"PixelFormat", pixel_formats[i].c_str());
 
  348         sensors_[i]->pixel_format = std::string(arv_device_get_string_feature_value(
p_device_, 
"PixelFormat"));
 
  356             ROS_WARN_STREAM(
"There is no known conversion from " << 
sensors_[i]->pixel_format << 
" to a usual ROS image encoding. Likely you need to implement one.");
 
  359         sensors_[i]->n_bits_pixel = ARV_PIXEL_FORMAT_BIT_PER_PIXEL(
 
  360           arv_device_get_integer_feature_value(
p_device_, 
"PixelFormat"));
 
  366     pnh.
param<
double>(
"softwaretriggerrate", 
config_.softwaretriggerrate, 
config_.softwaretriggerrate);
 
  386         double tf_publish_rate;
 
  387         pnh.
param<
double>(
"tf_publish_rate", tf_publish_rate, 0);
 
  388         if (tf_publish_rate > 0.)
 
  410         catch (
const YAML::BadFile& e)
 
  412             ROS_WARN(
"YAML file cannot be loaded: %s", e.what());
 
  413             ROS_WARN(
"Camera diagnostics will not be published.");
 
  415         catch (
const YAML::ParserException& e)
 
  417             ROS_WARN(
"YAML file is malformed: %s", e.what());
 
  418             ROS_WARN(
"Camera diagnostics will not be published.");
 
  432             ROS_WARN(
"No diagnostic features specified.");
 
  433             ROS_WARN(
"Camera diagnostics will not be published.");
 
  438         ROS_WARN(
"diagnostic_publish_rate is <= 0.0");
 
  439         ROS_WARN(
"Camera diagnostics will not be published.");
 
  443     ArvGcNode* p_gc_node;
 
  444     GError* error = NULL;
 
  446     p_gc_node = arv_device_get_feature(
p_device_, 
"DeviceSerialNumber");
 
  448     if (calib_urls[0].empty())
 
  450         if (arv_gc_feature_node_is_implemented(ARV_GC_FEATURE_NODE(p_gc_node), &error))
 
  452             GType device_serial_return_type = arv_gc_feature_node_get_value_type(ARV_GC_FEATURE_NODE(p_gc_node));
 
  456             if (device_serial_return_type == G_TYPE_STRING)
 
  458                 calib_urls[0] = arv_device_get_string_feature_value(
p_device_, 
"DeviceSerialNumber");
 
  459                 calib_urls[0] += 
".yaml";
 
  461             else if (device_serial_return_type == G_TYPE_INT64)
 
  463                 calib_urls[0] = arv_device_get_string_feature_value(
p_device_, 
"DeviceID");
 
  464                 calib_urls[0] += 
".yaml";
 
  472         std::string camera_info_frame_id = 
config_.frame_id;
 
  502     ROS_INFO(
"    Using Camera Configuration:");
 
  503     ROS_INFO(
"    ---------------------------");
 
  504     ROS_INFO(
"    Vendor name          = %s", arv_device_get_string_feature_value(
p_device_, 
"DeviceVendorName"));
 
  505     ROS_INFO(
"    Model name           = %s", arv_device_get_string_feature_value(
p_device_, 
"DeviceModelName"));
 
  506     ROS_INFO(
"    Device id            = %s", arv_device_get_string_feature_value(
p_device_, 
"DeviceUserID"));
 
  507     ROS_INFO(
"    Serial number        = %s", arv_device_get_string_feature_value(
p_device_, 
"DeviceSerialNumber"));
 
  510       arv_camera_is_uv_device(
p_camera_) ? 
"USB3Vision" : (arv_camera_is_gv_device(
p_camera_) ? 
"GigEVision" : 
"Other"));
 
  513     ROS_INFO(
"    ROI x,y,w,h          = %d, %d, %d, %d", 
roi_.x, 
roi_.y, 
roi_.width, 
roi_.height);
 
  525         ROS_INFO(
"    AcquisitionFrameRate = %g hz", 
config_.AcquisitionFrameRate);
 
  530         ROS_INFO(
"    BalanceWhiteAuto     = %s", awb_mode.c_str());
 
  533             for (
int l = 0; l < std::min(wb_ratio_selector_values.size(), wb_ratio_str_values.size());
 
  536                 arv_device_set_string_feature_value(
p_device_, wb_ratio_selector_feature.c_str(),
 
  537                                                     wb_ratio_selector_values[l].c_str());
 
  538                 float wb_ratio_val = arv_device_get_float_feature_value(
p_device_, wb_ratio_feature.c_str());
 
  539                 ROS_INFO(
"    BalanceRatio %s     = %f", wb_ratio_selector_values[l].c_str(), wb_ratio_val);
 
  562         ROS_INFO(
"    Network mtu          = %lu", arv_device_get_integer_feature_value(
p_device_, 
"GevSCPSPacketSize"));
 
  564     ROS_INFO(
"    ---------------------------");
 
  578                 ROS_WARN(
"PTP Error: ptp_set_cmd_feature_ '%s' is not available on the device.",
 
  597             arv_camera_gv_select_stream_channel(
p_camera_, i);
 
  603                 arv_camera_gv_select_stream_channel(
p_camera_, i);
 
  604                 const gint n_bytes_payload_stream_ = arv_camera_get_payload(
p_camera_);
 
  616                 ROS_WARN(
"Stream %i: Could not create image stream for %s.  Retrying...", i, 
guid_.c_str());
 
  624     std::vector<image_transport::SubscriberStatusCallback> image_cbs_;
 
  625     std::vector<ros::SubscriberStatusCallback> info_cbs_;
 
  636         std::string topic_name = this->
getName();
 
  645           1, image_cb, image_cb, info_cb, info_cb);
 
  651         StreamIdData* data = 
new StreamIdData();
 
  660         arv_stream_set_emit_signals(
p_streams_[i], TRUE);
 
  665                     { return pub.getNumSubscribers() > 0; }))
 
  682     ROS_INFO(
"Done initializing camera_aravis.");
 
  687     const char* feature_name = request.feature.c_str();
 
  688     response.response        = arv_device_get_integer_feature_value(this->
p_device_, feature_name);
 
  694     const char* feature_name = request.feature.c_str();
 
  695     guint64 value            = request.value;
 
  696     arv_device_set_integer_feature_value(this->
p_device_, feature_name, value);
 
  697     if (arv_device_get_status(this->
p_device_) == ARV_DEVICE_STATUS_SUCCESS)
 
  710     const char* feature_name = request.feature.c_str();
 
  711     response.response        = arv_device_get_float_feature_value(this->
p_device_, feature_name);
 
  717     const char* feature_name = request.feature.c_str();
 
  718     const double value       = request.value;
 
  719     arv_device_set_float_feature_value(this->
p_device_, feature_name, value);
 
  720     if (arv_device_get_status(this->
p_device_) == ARV_DEVICE_STATUS_SUCCESS)
 
  733     const char* feature_name = request.feature.c_str();
 
  734     response.response        = arv_device_get_string_feature_value(this->
p_device_, feature_name);
 
  740     const char* feature_name = request.feature.c_str();
 
  741     const char* value        = request.value.c_str();
 
  742     arv_device_set_string_feature_value(this->
p_device_, feature_name, value);
 
  743     if (arv_device_get_status(this->
p_device_) == ARV_DEVICE_STATUS_SUCCESS)
 
  756     const char* feature_name = request.feature.c_str();
 
  757     response.response        = arv_device_get_boolean_feature_value(this->
p_device_, feature_name);
 
  763     const char* feature_name = request.feature.c_str();
 
  764     const bool value         = request.value;
 
  765     arv_device_set_boolean_feature_value(this->
p_device_, feature_name, value);
 
  766     if (arv_device_get_status(this->
p_device_) == ARV_DEVICE_STATUS_SUCCESS)
 
  789     arv_device_set_string_feature_value(
p_device_, 
"BalanceWhiteAuto", 
"Once");
 
  790     if (arv_device_get_status(this->
p_device_) == ARV_DEVICE_STATUS_SUCCESS)
 
  792         const char* tmpCharPtr = arv_device_get_string_feature_value(
p_device_, 
"BalanceWhiteAuto");
 
  793         std::string modeStr = 
"n/a";
 
  795             modeStr = std::string(tmpCharPtr);
 
  799             arv_device_set_string_feature_value(
p_device_, 
"BalanceRatioSelector", 
"Red");
 
  800             response.balance_ratio_red = 
static_cast<float>(
 
  801                 arv_device_get_float_feature_value(
p_device_, 
"BalanceRatio"));
 
  803             arv_device_set_string_feature_value(
p_device_, 
"BalanceRatioSelector", 
"Green");
 
  804             response.balance_ratio_green = 
static_cast<float>(
 
  805                 arv_device_get_float_feature_value(
p_device_, 
"BalanceRatio"));
 
  807             arv_device_set_string_feature_value(
p_device_, 
"BalanceRatioSelector", 
"Blue");
 
  808             response.balance_ratio_blue = 
static_cast<float>(
 
  809                 arv_device_get_float_feature_value(
p_device_, 
"BalanceRatio"));
 
  812         ROS_INFO(
"Setting Auto White Balance successful!");
 
  813         ROS_INFO(
"> BalanceWhiteAuto Mode:   %s", modeStr.c_str());
 
  824         ROS_ERROR(
"Trying to set Auto White Balance once failed!");
 
  834         ROS_WARN(
"PTP Error: ptp_status_feature_name and/or ptp_enable_feature_name are empty.");
 
  841             ROS_WARN(
"PTP Error: ptp_status_feature_name '%s' is not available on the device.",
 
  844             ROS_WARN(
"PTP Error: ptp_enable_feature_name '%s' is not available on the device.",
 
  850     const char* ptpS_satus_char_ptr =
 
  852     std::string ptp_status_str = (ptpS_satus_char_ptr) ? std::string(ptpS_satus_char_ptr) : 
"Faulty";
 
  854     if (ptp_status_str == 
"Faulty" ||
 
  855         ptp_status_str == 
"Disabled" ||
 
  856         ptp_status_str == 
"Initializing" ||
 
  859         ROS_INFO(
"Resetting ptp clock (was set to %s)", ptp_status_str.c_str());
 
  873             arv_device_set_float_feature_value(
p_device_, 
"ExposureTime", msg_ptr->exposure_time);
 
  882                     arv_device_set_string_feature_value(
p_device_, 
"GainSelector", 
"All");
 
  884                 arv_device_set_float_feature_value(
p_device_, 
"Gain", msg_ptr->gain);
 
  891                     arv_device_set_string_feature_value(
p_device_, 
"GainSelector", 
"Red");
 
  892                     arv_device_set_float_feature_value(
p_device_, 
"Gain", msg_ptr->gain_red);
 
  897                     arv_device_set_string_feature_value(
p_device_, 
"GainSelector", 
"Green");
 
  898                     arv_device_set_float_feature_value(
p_device_, 
"Gain", msg_ptr->gain_green);
 
  903                     arv_device_set_string_feature_value(
p_device_, 
"GainSelector", 
"Blue");
 
  904                     arv_device_set_float_feature_value(
p_device_, 
"Gain", msg_ptr->gain_blue);
 
  915                     arv_device_set_string_feature_value(
p_device_, 
"BlackLevelSelector", 
"All");
 
  917                 arv_device_set_float_feature_value(
p_device_, 
"BlackLevel", msg_ptr->black_level);
 
  924                     arv_device_set_string_feature_value(
p_device_, 
"BlackLevelSelector", 
"Red");
 
  925                     arv_device_set_float_feature_value(
p_device_, 
"BlackLevel", msg_ptr->bl_red);
 
  930                     arv_device_set_string_feature_value(
p_device_, 
"BlackLevelSelector", 
"Green");
 
  931                     arv_device_set_float_feature_value(
p_device_, 
"BlackLevel", msg_ptr->bl_green);
 
  936                     arv_device_set_string_feature_value(
p_device_, 
"BlackLevelSelector", 
"Blue");
 
  937                     arv_device_set_float_feature_value(
p_device_, 
"BlackLevel", msg_ptr->bl_blue);
 
  943         if (strcmp(
"The Imaging Source Europe GmbH", arv_camera_get_vendor_name(
p_camera_)) == 0)
 
  945             arv_device_set_integer_feature_value(
p_device_, 
"WhiteBalanceRedRegister", (
int)(
auto_params_.wb_red * 255.));
 
  946             arv_device_set_integer_feature_value(
p_device_, 
"WhiteBalanceGreenRegister", (
int)(
auto_params_.wb_green * 255.));
 
  947             arv_device_set_integer_feature_value(
p_device_, 
"WhiteBalanceBlueRegister", (
int)(
auto_params_.wb_blue * 255.));
 
  953                 arv_device_set_string_feature_value(
p_device_, 
"BalanceRatioSelector", 
"Red");
 
  954                 arv_device_set_float_feature_value(
p_device_, 
"BalanceRatio", msg_ptr->wb_red);
 
  959                 arv_device_set_string_feature_value(
p_device_, 
"BalanceRatioSelector", 
"Green");
 
  960                 arv_device_set_float_feature_value(
p_device_, 
"BalanceRatio", msg_ptr->wb_green);
 
  965                 arv_device_set_string_feature_value(
p_device_, 
"BalanceRatioSelector", 
"Blue");
 
  966                 arv_device_set_float_feature_value(
p_device_, 
"BalanceRatio", msg_ptr->wb_blue);
 
  979           std::numeric_limits<double>::quiet_NaN();
 
  992                 arv_device_set_string_feature_value(
p_device_, 
"GainSelector", 
"All");
 
  997                 arv_device_set_string_feature_value(
p_device_, 
"GainSelector", 
"Red");
 
  999                 arv_device_set_string_feature_value(
p_device_, 
"GainSelector", 
"Green");
 
 1001                 arv_device_set_string_feature_value(
p_device_, 
"GainSelector", 
"Blue");
 
 1010                 arv_device_set_string_feature_value(
p_device_, 
"BlackLevelSelector", 
"All");
 
 1015                 arv_device_set_string_feature_value(
p_device_, 
"BlackLevelSelector", 
"Red");
 
 1017                 arv_device_set_string_feature_value(
p_device_, 
"BlackLevelSelector", 
"Green");
 
 1019                 arv_device_set_string_feature_value(
p_device_, 
"BlackLevelSelector", 
"Blue");
 
 1025         if (strcmp(
"The Imaging Source Europe GmbH", arv_camera_get_vendor_name(
p_camera_)) == 0)
 
 1027             auto_params_.wb_red   = arv_device_get_integer_feature_value(
p_device_, 
"WhiteBalanceRedRegister") / 255.;
 
 1028             auto_params_.wb_green = arv_device_get_integer_feature_value(
p_device_, 
"WhiteBalanceGreenRegister") / 255.;
 
 1029             auto_params_.wb_blue  = arv_device_get_integer_feature_value(
p_device_, 
"WhiteBalanceBlueRegister") / 255.;
 
 1034             arv_device_set_string_feature_value(
p_device_, 
"BalanceRatioSelector", 
"Red");
 
 1036             arv_device_set_string_feature_value(
p_device_, 
"BalanceRatioSelector", 
"Green");
 
 1038             arv_device_set_string_feature_value(
p_device_, 
"BalanceRatioSelector", 
"Blue");
 
 1064             arv_device_set_string_feature_value(
p_device_, 
"ExposureAuto", 
"Off");
 
 1068             arv_device_set_string_feature_value(
p_device_, 
"GainAuto", 
"Off");
 
 1072             arv_device_set_string_feature_value(
p_device_, 
"GainAutoBalance", 
"Off");
 
 1076             arv_device_set_string_feature_value(
p_device_, 
"BlackLevelAuto", 
"Off");
 
 1080             arv_device_set_string_feature_value(
p_device_, 
"BlackLevelAutoBalance", 
"Off");
 
 1084             arv_device_set_string_feature_value(
p_device_, 
"BalanceWhiteAuto", 
"Off");
 
 1100         if (channel_name.empty())
 
 1118     gboolean b_auto_buffer               = FALSE;
 
 1119     gboolean b_packet_resend             = TRUE;
 
 1120     unsigned int timeout_packet          = 40; 
 
 1121     unsigned int timeout_frame_retention = 200;
 
 1125         if (!ARV_IS_GV_STREAM(p_stream))
 
 1127             ROS_WARN(
"Stream is not a GV_STREAM");
 
 1132             g_object_set(p_stream, 
"socket-buffer", ARV_GV_STREAM_SOCKET_BUFFER_AUTO, 
"socket-buffer-size", 0,
 
 1134         if (!b_packet_resend)
 
 1135             g_object_set(p_stream, 
"packet-resend",
 
 1136                          b_packet_resend ? ARV_GV_STREAM_PACKET_RESEND_ALWAYS : ARV_GV_STREAM_PACKET_RESEND_NEVER,
 
 1138         g_object_set(p_stream, 
"packet-timeout", timeout_packet * 1000, 
"frame-retention", timeout_frame_retention * 1000,
 
 1149     if (config.frame_id == 
"")
 
 1150         config.frame_id = this->
getName();
 
 1153     config.AcquisitionFrameRate = CLAMP(config.AcquisitionFrameRate, 
config_min_.AcquisitionFrameRate,
 
 1158     config.frame_id             = 
tf::resolve(tf_prefix, config.frame_id);
 
 1164     if (config.AutoSlave)
 
 1166         config.ExposureAuto = 
"Off";
 
 1167         config.GainAuto     = 
"Off";
 
 1172     if (config.ExposureAuto.compare(
"Off") != 0)
 
 1174         config.ExposureTime = 
config_.ExposureTime;
 
 1175         ROS_WARN(
"ExposureAuto is active. Cannot manually set ExposureTime.");
 
 1177     if (config.GainAuto.compare(
"Off") != 0)
 
 1180         ROS_WARN(
"GainAuto is active. Cannot manually set Gain.");
 
 1184     if (config.TriggerMode.compare(
"Off") != 0)
 
 1186         config.AcquisitionFrameRate = 
config_.AcquisitionFrameRate;
 
 1187         ROS_WARN(
"TriggerMode is active (Trigger Source: %s). Cannot manually set AcquisitionFrameRate.", 
config_.TriggerSource.c_str());
 
 1191     const bool changed_auto_master            = (
config_.AutoMaster != config.AutoMaster);
 
 1192     const bool changed_auto_slave             = (
config_.AutoSlave != config.AutoSlave);
 
 1193     const bool changed_acquisition_frame_rate = (
config_.AcquisitionFrameRate != config.AcquisitionFrameRate);
 
 1194     const bool changed_exposure_auto          = (
config_.ExposureAuto != config.ExposureAuto);
 
 1195     const bool changed_exposure_time          = (
config_.ExposureTime != config.ExposureTime);
 
 1196     const bool changed_gain_auto              = (
config_.GainAuto != config.GainAuto);
 
 1197     const bool changed_gain                   = (
config_.Gain != config.Gain);
 
 1198     const bool changed_acquisition_mode       = (
config_.AcquisitionMode != config.AcquisitionMode);
 
 1199     const bool changed_trigger_mode           = (
config_.TriggerMode != config.TriggerMode);
 
 1200     const bool changed_trigger_source         = (
config_.TriggerSource != config.TriggerSource) || changed_trigger_mode;
 
 1201     const bool changed_focus_pos              = (
config_.FocusPos != config.FocusPos);
 
 1202     const bool changed_mtu                    = (
config_.mtu != config.mtu);
 
 1204     if (changed_auto_master)
 
 1209     if (changed_auto_slave)
 
 1215     if (changed_exposure_time)
 
 1219             ROS_INFO(
"Set ExposureTime = %f us", config.ExposureTime);
 
 1220             arv_camera_set_exposure_time(
p_camera_, config.ExposureTime);
 
 1223             ROS_INFO(
"Camera does not support ExposureTime.");
 
 1230             ROS_INFO(
"Set gain = %f", config.Gain);
 
 1231             arv_camera_set_gain(
p_camera_, config.Gain);
 
 1234             ROS_INFO(
"Camera does not support Gain or GainRaw.");
 
 1237     if (changed_exposure_auto)
 
 1241             ROS_INFO(
"Set ExposureAuto = %s", config.ExposureAuto.c_str());
 
 1242             arv_device_set_string_feature_value(
p_device_, 
"ExposureAuto", config.ExposureAuto.c_str());
 
 1243             if (config.ExposureAuto.compare(
"Once") == 0)
 
 1246                 config.ExposureTime = arv_camera_get_exposure_time(
p_camera_);
 
 1247                 ROS_INFO(
"Get ExposureTime = %f us", config.ExposureTime);
 
 1248                 config.ExposureAuto = 
"Off";
 
 1252             ROS_INFO(
"Camera does not support ExposureAuto.");
 
 1254     if (changed_gain_auto)
 
 1258             ROS_INFO(
"Set GainAuto = %s", config.GainAuto.c_str());
 
 1259             arv_device_set_string_feature_value(
p_device_, 
"GainAuto", config.GainAuto.c_str());
 
 1260             if (config.GainAuto.compare(
"Once") == 0)
 
 1263                 config.Gain = arv_camera_get_gain(
p_camera_);
 
 1264                 ROS_INFO(
"Get Gain = %f", config.Gain);
 
 1265                 config.GainAuto = 
"Off";
 
 1269             ROS_INFO(
"Camera does not support GainAuto.");
 
 1272     if (changed_acquisition_frame_rate)
 
 1276             ROS_INFO(
"Set frame rate = %f Hz", config.AcquisitionFrameRate);
 
 1277             arv_camera_set_frame_rate(
p_camera_, config.AcquisitionFrameRate);
 
 1280             ROS_INFO(
"Camera does not support AcquisitionFrameRate.");
 
 1283     if (changed_trigger_mode)
 
 1287             ROS_INFO(
"Set TriggerMode = %s", config.TriggerMode.c_str());
 
 1288             arv_device_set_string_feature_value(
p_device_, 
"TriggerMode", config.TriggerMode.c_str());
 
 1291             ROS_INFO(
"Camera does not support TriggerMode.");
 
 1294     if (changed_trigger_source)
 
 1305             ROS_INFO(
"Set TriggerSource = %s", config.TriggerSource.c_str());
 
 1306             arv_device_set_string_feature_value(
p_device_, 
"TriggerSource", config.TriggerSource.c_str());
 
 1310             ROS_INFO(
"Camera does not support TriggerSource.");
 
 1314         if (config.TriggerMode.compare(
"On") == 0 && config.TriggerSource.compare(
"Software") == 0)
 
 1318                 config_.softwaretriggerrate = config.softwaretriggerrate;
 
 1319                 ROS_INFO(
"Set softwaretriggerrate = %f", 1000.0 / ceil(1000.0 / config.softwaretriggerrate));
 
 1326                 ROS_INFO(
"Camera does not support TriggerSoftware command.");
 
 1331     if (changed_focus_pos)
 
 1335             ROS_INFO(
"Set FocusPos = %d", config.FocusPos);
 
 1336             arv_device_set_integer_feature_value(
p_device_, 
"FocusPos", config.FocusPos);
 
 1338             config.FocusPos = arv_device_get_integer_feature_value(
p_device_, 
"FocusPos");
 
 1339             ROS_INFO(
"Get FocusPos = %d", config.FocusPos);
 
 1342             ROS_INFO(
"Camera does not support FocusPos.");
 
 1349             ROS_INFO(
"Set mtu = %d", config.mtu);
 
 1350             arv_device_set_integer_feature_value(
p_device_, 
"GevSCPSPacketSize", config.mtu);
 
 1352             config.mtu = arv_device_get_integer_feature_value(
p_device_, 
"GevSCPSPacketSize");
 
 1353             ROS_INFO(
"Get mtu = %d", config.mtu);
 
 1356             ROS_INFO(
"Camera does not support mtu (i.e. GevSCPSPacketSize).");
 
 1359     if (changed_acquisition_mode)
 
 1363             ROS_INFO(
"Set AcquisitionMode = %s", config.AcquisitionMode.c_str());
 
 1364             arv_device_set_string_feature_value(
p_device_, 
"AcquisitionMode", config.AcquisitionMode.c_str());
 
 1367             arv_device_execute_command(
p_device_, 
"AcquisitionStop");
 
 1369             arv_device_execute_command(
p_device_, 
"AcquisitionStart");
 
 1372             ROS_INFO(
"Camera does not support AcquisitionMode.");
 
 1386                         { return pub.getNumSubscribers() == 0; }))
 
 1388             arv_device_execute_command(
p_device_, 
"AcquisitionStop"); 
 
 1392             arv_device_execute_command(
p_device_, 
"AcquisitionStart");
 
 1412         const std::string stream_frame_id = p_can->
config_.frame_id + 
"/" + p_can->
stream_names_[stream_id];
 
 1419     ArvBuffer* p_buffer = arv_stream_try_pop_buffer(p_stream);
 
 1422     gint n_available_buffers;
 
 1423     arv_stream_get_n_buffers(p_stream, &n_available_buffers, NULL);
 
 1424     if (n_available_buffers == 0)
 
 1426         p_can->p_buffer_pools_[stream_id]->allocateBuffers(1);
 
 1429     if (p_buffer != NULL)
 
 1431         if (arv_buffer_get_status(p_buffer) == ARV_BUFFER_STATUS_SUCCESS && p_can->p_buffer_pools_[stream_id] && p_can->cam_pubs_[stream_id].getNumSubscribers())
 
 1433             (p_can->n_buffers_)++;
 
 1435             sensor_msgs::ImagePtr msg_ptr = (*(p_can->p_buffer_pools_[stream_id]))[p_buffer];
 
 1439             if (p_can->use_ptp_stamp_)
 
 1440                 t = arv_buffer_get_timestamp(p_buffer);
 
 1442                 t = arv_buffer_get_system_timestamp(p_buffer);
 
 1443             msg_ptr->header.stamp.fromNSec(t);
 
 1445             msg_ptr->header.seq = arv_buffer_get_frame_id(p_buffer);
 
 1447             msg_ptr->header.frame_id = frame_id;
 
 1448             msg_ptr->width           = p_can->roi_.width;
 
 1449             msg_ptr->height          = p_can->roi_.height;
 
 1450             msg_ptr->encoding        = p_can->sensors_[stream_id]->pixel_format;
 
 1451             msg_ptr->step            = (msg_ptr->width * p_can->sensors_[stream_id]->n_bits_pixel) / 8;
 
 1454             if (p_can->convert_formats[stream_id])
 
 1456                 sensor_msgs::ImagePtr cvt_msg_ptr = p_can->p_buffer_pools_[stream_id]->getRecyclableImg();
 
 1457                 p_can->convert_formats[stream_id](msg_ptr, cvt_msg_ptr);
 
 1458                 msg_ptr = cvt_msg_ptr;
 
 1462             if (!p_can->camera_infos_[stream_id])
 
 1464                 p_can->camera_infos_[stream_id].reset(
new sensor_msgs::CameraInfo);
 
 1466             (*p_can->camera_infos_[stream_id])      = p_can->p_camera_info_managers_[stream_id]->getCameraInfo();
 
 1467             p_can->camera_infos_[stream_id]->header = msg_ptr->header;
 
 1468             if (p_can->camera_infos_[stream_id]->width == 0 || p_can->camera_infos_[stream_id]->height == 0)
 
 1471                   "The fields image_width and image_height seem not to be set in " 
 1472                   "the YAML specified by 'camera_info_url' parameter. Please set " 
 1473                   "them there, because actual image size and specified image size " 
 1474                   "can be different due to the region of interest (ROI) feature. In " 
 1475                   "the YAML the image size should be the one on which the camera was " 
 1476                   "calibrated. See CameraInfo.msg specification!");
 
 1477                 p_can->camera_infos_[stream_id]->width  = p_can->roi_.width;
 
 1478                 p_can->camera_infos_[stream_id]->height = p_can->roi_.height;
 
 1481             p_can->cam_pubs_[stream_id].publish(msg_ptr, p_can->camera_infos_[stream_id]);
 
 1483             if (p_can->pub_ext_camera_info_)
 
 1485                 ExtendedCameraInfo extended_camera_info_msg;
 
 1486                 p_can->extended_camera_info_mutex_.lock();
 
 1487                 arv_camera_gv_select_stream_channel(p_can->p_camera_, stream_id);
 
 1488                 extended_camera_info_msg.camera_info = *(p_can->camera_infos_[stream_id]);
 
 1489                 p_can->fillExtendedCameraInfoMessage(extended_camera_info_msg);
 
 1490                 p_can->extended_camera_info_mutex_.unlock();
 
 1491                 p_can->extended_camera_info_pubs_[stream_id].publish(extended_camera_info_msg);
 
 1495             if (p_can->use_ptp_stamp_)
 
 1496                 p_can->resetPtpClock();
 
 1500             if (arv_buffer_get_status(p_buffer) != ARV_BUFFER_STATUS_SUCCESS)
 
 1504             arv_stream_push_buffer(p_stream, p_buffer);
 
 1509     if (p_can->config_.AutoMaster)
 
 1511         p_can->syncAutoParameters();
 
 1512         p_can->auto_pub_.publish(p_can->auto_params_);
 
 1518     const char* vendor_name = arv_camera_get_vendor_name(
p_camera_);
 
 1520     if (strcmp(
"Basler", vendor_name) == 0)
 
 1522         msg.exposure_time = arv_device_get_float_feature_value(
p_device_, 
"ExposureTimeAbs");
 
 1526         msg.exposure_time = arv_device_get_float_feature_value(
p_device_, 
"ExposureTime");
 
 1529     if (strcmp(
"Basler", vendor_name) == 0)
 
 1531         msg.gain = 
static_cast<float>(arv_device_get_integer_feature_value(
p_device_, 
"GainRaw"));
 
 1535         msg.gain = arv_device_get_float_feature_value(
p_device_, 
"Gain");
 
 1537     if (strcmp(
"Basler", vendor_name) == 0)
 
 1539         arv_device_set_string_feature_value(
p_device_, 
"BlackLevelSelector", 
"All");
 
 1540         msg.black_level = 
static_cast<float>(arv_device_get_integer_feature_value(
p_device_, 
"BlackLevelRaw"));
 
 1542     else if (strcmp(
"JAI Corporation", vendor_name) == 0)
 
 1546         msg.black_level = 0;
 
 1550         arv_device_set_string_feature_value(
p_device_, 
"BlackLevelSelector", 
"All");
 
 1551         msg.black_level = arv_device_get_float_feature_value(
p_device_, 
"BlackLevel");
 
 1555     if (strcmp(
"The Imaging Source Europe GmbH", vendor_name) == 0)
 
 1557         msg.white_balance_red   = arv_device_get_integer_feature_value(
p_device_, 
"WhiteBalanceRedRegister") / 255.;
 
 1558         msg.white_balance_green = arv_device_get_integer_feature_value(
p_device_, 
"WhiteBalanceGreenRegister") / 255.;
 
 1559         msg.white_balance_blue  = arv_device_get_integer_feature_value(
p_device_, 
"WhiteBalanceBlueRegister") / 255.;
 
 1563     else if (strcmp(
"JAI Corporation", vendor_name) == 0)
 
 1565         msg.white_balance_red   = 1.0;
 
 1566         msg.white_balance_green = 1.0;
 
 1567         msg.white_balance_blue  = 1.0;
 
 1570     else if (strcmp(
"Basler", vendor_name) == 0)
 
 1572         arv_device_set_string_feature_value(
p_device_, 
"BalanceRatioSelector", 
"Red");
 
 1573         msg.white_balance_red = arv_device_get_float_feature_value(
p_device_, 
"BalanceRatioAbs");
 
 1574         arv_device_set_string_feature_value(
p_device_, 
"BalanceRatioSelector", 
"Green");
 
 1575         msg.white_balance_green = arv_device_get_float_feature_value(
p_device_, 
"BalanceRatioAbs");
 
 1576         arv_device_set_string_feature_value(
p_device_, 
"BalanceRatioSelector", 
"Blue");
 
 1577         msg.white_balance_blue = arv_device_get_float_feature_value(
p_device_, 
"BalanceRatioAbs");
 
 1582         arv_device_set_string_feature_value(
p_device_, 
"BalanceRatioSelector", 
"Red");
 
 1583         msg.white_balance_red = arv_device_get_float_feature_value(
p_device_, 
"BalanceRatio");
 
 1584         arv_device_set_string_feature_value(
p_device_, 
"BalanceRatioSelector", 
"Green");
 
 1585         msg.white_balance_green = arv_device_get_float_feature_value(
p_device_, 
"BalanceRatio");
 
 1586         arv_device_set_string_feature_value(
p_device_, 
"BalanceRatioSelector", 
"Blue");
 
 1587         msg.white_balance_blue = arv_device_get_float_feature_value(
p_device_, 
"BalanceRatio");
 
 1590     if (strcmp(
"Basler", vendor_name) == 0)
 
 1592         msg.temperature = 
static_cast<float>(arv_device_get_float_feature_value(
p_device_, 
"TemperatureAbs"));
 
 1596         msg.temperature = arv_device_get_float_feature_value(
p_device_, 
"DeviceTemperature");
 
 1613     ROS_INFO(
"Software trigger started.");
 
 1614     std::chrono::system_clock::time_point next_time = std::chrono::system_clock::now();
 
 1617         next_time += std::chrono::milliseconds(
size_t(std::round(1000.0 / 
config_.softwaretriggerrate)));
 
 1620                         { return pub.getNumSubscribers() > 0; }))
 
 1622             arv_device_execute_command(
p_device_, 
"TriggerSoftware");
 
 1624         if (next_time > std::chrono::system_clock::now())
 
 1626             std::this_thread::sleep_until(next_time);
 
 1630             ROS_WARN(
"Camera Aravis: Missed a software trigger event.");
 
 1631             next_time = std::chrono::system_clock::now();
 
 1634     ROS_INFO(
"Software trigger stopped.");
 
 1640     ROS_WARN(
"Publishing dynamic camera transforms (/tf) at %g Hz", rate);
 
 1659     ROS_INFO(
"Publishing camera diagnostics at %g Hz", rate);
 
 1663     CameraDiagnostics camDiagnosticMsg;
 
 1664     camDiagnosticMsg.header.frame_id = 
config_.frame_id;
 
 1667     auto getFeatureValueAsStrFn = [&](
const std::string& name, 
const std::string& type)
 
 1670         std::string valueStr = 
"";
 
 1672         if (type == 
"float")
 
 1674             valueStr = std::to_string(arv_device_get_float_feature_value(
p_device_, name.c_str()));
 
 1676         else if (type == 
"int")
 
 1678             valueStr = std::to_string(arv_device_get_integer_feature_value(
p_device_, name.c_str()));
 
 1680         else if (type == 
"bool")
 
 1682             valueStr = arv_device_get_boolean_feature_value(
p_device_, name.c_str()) ? 
"true" : 
"false";
 
 1686             const char* retFeatVal = arv_device_get_string_feature_value(
p_device_, name.c_str());
 
 1687             valueStr               = (retFeatVal) ? std::string(retFeatVal) : 
"";
 
 1694     auto setFeatureValueFromStrFn = [&](
const std::string& name, 
const std::string& type,
 
 1695                                         const std::string& valueStr)
 
 1697         if (type == 
"float")
 
 1698             arv_device_set_float_feature_value(
p_device_, name.c_str(), std::stod(valueStr));
 
 1699         else if (type == 
"int")
 
 1700             arv_device_set_integer_feature_value(
p_device_, name.c_str(), std::stoi(valueStr));
 
 1701         else if (type == 
"bool")
 
 1702             arv_device_set_boolean_feature_value(
p_device_, name.c_str(),
 
 1703                                                  (valueStr == 
"true" || valueStr == 
"True" || valueStr == 
"TRUE"));
 
 1705             arv_device_set_string_feature_value(
p_device_, name.c_str(), valueStr.c_str());
 
 1711         ++camDiagnosticMsg.header.seq;
 
 1713         camDiagnosticMsg.data.clear();
 
 1718             std::string featureName = featureDict[
"FeatureName"].IsDefined()
 
 1719                                         ? featureDict[
"FeatureName"].as<std::string>()
 
 1721             std::string featureType = featureDict[
"Type"].IsDefined()
 
 1722                                         ? featureDict[
"Type"].as<std::string>()
 
 1725             if (featureName.empty() || featureType.empty())
 
 1728                   "Diagnostic feature at index %i does not have a field 'FeatureName' or 'Type'.",
 
 1735                 std::transform(featureType.begin(), featureType.end(), featureType.begin(),
 
 1737                                { return std::tolower(c); });
 
 1743                     diagnostic_msgs::KeyValue kvPair;
 
 1746                     if (featureDict[
"Selectors"].IsDefined() && featureDict[
"Selectors"].size() > 0)
 
 1748                         int selectorIdx = 1;
 
 1749                         for (
auto selectorDict : featureDict[
"Selectors"])
 
 1751                             std::string selectorFeatureName = selectorDict[
"FeatureName"].IsDefined()
 
 1752                                                                 ? selectorDict[
"FeatureName"].as<std::string>()
 
 1754                             std::string selectorType        = selectorDict[
"Type"].IsDefined()
 
 1755                                                                 ? selectorDict[
"Type"].as<std::string>()
 
 1757                             std::string selectorValue       = selectorDict[
"Value"].IsDefined()
 
 1758                                                                 ? selectorDict[
"Value"].as<std::string>()
 
 1761                             if (selectorFeatureName.empty() || selectorType.empty() || selectorValue.empty())
 
 1764                                   "Diagnostic feature selector at index %i of feature at index %i does not have a " 
 1765                                   "field 'FeatureName', 'Type' or 'Value'.",
 
 1766                                   selectorIdx, featureIdx);
 
 1774                                     setFeatureValueFromStrFn(selectorFeatureName, selectorType, selectorValue);
 
 1776                                     kvPair.key   = featureName + 
"-" + selectorValue;
 
 1777                                     kvPair.value = getFeatureValueAsStrFn(featureName, featureType);
 
 1779                                     camDiagnosticMsg.data.push_back(diagnostic_msgs::KeyValue(kvPair));
 
 1783                                     ROS_WARN_ONCE(
"Diagnostic feature selector with name '%s' is not implemented.",
 
 1784                                                   selectorFeatureName.c_str());
 
 1793                         kvPair.key   = featureName;
 
 1794                         kvPair.value = getFeatureValueAsStrFn(featureName, featureType);
 
 1796                         camDiagnosticMsg.data.push_back(diagnostic_msgs::KeyValue(kvPair));
 
 1801                     ROS_WARN_ONCE(
"Diagnostic feature with name '%s' is not implemented.",
 
 1802                                   featureName.c_str());
 
 1822     ArvGc* gc = arv_device_get_genicam(
p_device_);
 
 1826     std::list<ArvDomNode*> todo;
 
 1827     todo.push_front((ArvDomNode*)arv_gc_get_node(gc, 
"Root"));
 
 1829     while (!todo.empty())
 
 1832         ArvDomNode* node = todo.front();
 
 1834         const std::string name(arv_dom_node_get_node_name(node));
 
 1839             if (name.compare(
"pInvalidator") == 0)
 
 1843             ArvDomNode* inode = (ArvDomNode*)arv_gc_get_node(gc,
 
 1844                                                              arv_dom_node_get_node_value(arv_dom_node_get_first_child(node)));
 
 1846                 todo.push_front(inode);
 
 1851         if (ARV_IS_GC_FEATURE_NODE(node))
 
 1854             ArvGcFeatureNode* fnode = ARV_GC_FEATURE_NODE(node);
 
 1855             const std::string fname(arv_gc_feature_node_get_name(fnode));
 
 1856             const bool usable = arv_gc_feature_node_is_available(fnode, NULL) && arv_gc_feature_node_is_implemented(fnode, NULL);
 
 1870         ArvDomNodeList* children = arv_dom_node_get_child_nodes(node);
 
 1871         const uint l             = arv_dom_node_list_get_length(children);
 
 1872         for (uint i = 0; i < l; ++i)
 
 1874             todo.push_front(arv_dom_node_list_get_item(children, i));
 
 1881     size_t array_start = 0;
 
 1882     size_t array_end   = in_arg_string.length();
 
 1883     if (array_start != std::string::npos && array_end != std::string::npos)
 
 1886         std::stringstream ss(in_arg_string.substr(array_start, array_end - array_start));
 
 1890             getline(ss, temp, 
',');
 
 1891             boost::trim_left(temp);
 
 1892             boost::trim_right(temp);
 
 1893             out_args.push_back(temp);
 
 1899         out_args.push_back(in_arg_string);
 
 1916     ArvGcNode* p_gc_node;
 
 1917     GError* error = NULL;
 
 1923         for (iter = xml_rpc_params.
begin(); iter != xml_rpc_params.
end(); iter++)
 
 1925             std::string key = iter->first;
 
 1927             p_gc_node = arv_device_get_feature(
p_device_, key.c_str());
 
 1928             if (p_gc_node && arv_gc_feature_node_is_implemented(ARV_GC_FEATURE_NODE(p_gc_node), &error))
 
 1934                 switch (iter->second.getType())
 
 1938                     int value = (bool)iter->second;
 
 1939                     arv_device_set_integer_feature_value(
p_device_, key.c_str(), value);
 
 1940                     ROS_INFO(
"Read parameter (bool) %s: %d", key.c_str(), value);
 
 1946                     int value = (int)iter->second;
 
 1947                     arv_device_set_integer_feature_value(
p_device_, key.c_str(), value);
 
 1948                     ROS_INFO(
"Read parameter (int) %s: %d", key.c_str(), value);
 
 1954                     double value = (double)iter->second;
 
 1955                     arv_device_set_float_feature_value(
p_device_, key.c_str(), value);
 
 1956                     ROS_INFO(
"Read parameter (float) %s: %f", key.c_str(), value);
 
 1962                     std::string value = (std::string)iter->second;
 
 1963                     arv_device_set_string_feature_value(
p_device_, key.c_str(), value.c_str());
 
 1964                     ROS_INFO(
"Read parameter (string) %s: %s", key.c_str(), value.c_str());
 
 1974                     ROS_WARN(
"Unhandled rosparam type in writeCameraFeaturesFromRosparam()");
 
 1983     nodelet::NodeletUnload unload_service;
 
 1984     unload_service.request.name = this->
getName();