37 #ifndef STCAMERA_STCAMERA_INTERFACE_H 38 #define STCAMERA_STCAMERA_INTERFACE_H 45 #include <sensor_msgs/CameraInfo.h> 47 #include <omronsentech_camera/Event.h> 48 #include <omronsentech_camera/Chunk.h> 50 #include <omronsentech_camera/ReadNode.h> 51 #include <omronsentech_camera/ReadNodeBool.h> 52 #include <omronsentech_camera/ReadNodeEnum.h> 53 #include <omronsentech_camera/ReadNodeInt.h> 54 #include <omronsentech_camera/ReadNodeFloat.h> 55 #include <omronsentech_camera/ReadNodeString.h> 57 #include <omronsentech_camera/WriteNode.h> 58 #include <omronsentech_camera/WriteNodeBool.h> 59 #include <omronsentech_camera/WriteNodeEnumInt.h> 60 #include <omronsentech_camera/WriteNodeEnumStr.h> 61 #include <omronsentech_camera/WriteNodeInt.h> 62 #include <omronsentech_camera/WriteNodeFloat.h> 63 #include <omronsentech_camera/WriteNodeString.h> 64 #include <omronsentech_camera/ExecuteNode.h> 66 #include <omronsentech_camera/EnableChunk.h> 67 #include <omronsentech_camera/EnableTrigger.h> 68 #include <omronsentech_camera/EnableEventNode.h> 69 #include <omronsentech_camera/EnableImageAcquisition.h> 70 #include <omronsentech_camera/EnableEventAcquisition.h> 72 #include <omronsentech_camera/GetImageAcquisitionStatus.h> 73 #include <omronsentech_camera/GetEventAcquisitionStatusList.h> 74 #include <omronsentech_camera/GetEventNodeStatusList.h> 75 #include <omronsentech_camera/GetChunkList.h> 76 #include <omronsentech_camera/GetTriggerList.h> 77 #include <omronsentech_camera/GetEnumList.h> 78 #include <omronsentech_camera/GetGenICamNodeInfo.h> 79 #include <omronsentech_camera/SendSoftTrigger.h> 80 #include <omronsentech_camera/GetLastError.h> 91 #define RETURN_ERR(X, MSG) \ 92 ROS_ERROR("%s %s %d: \n\t%s error: %s", \ 93 __FILE__,__func__,__LINE__,camera_namespace_.c_str(),MSG); \ 94 last_error_ = X; return false; 97 #define CHECK_NULLPTR(P, X, MSG) if (nullptr == P) \ 98 { RETURN_ERR(X, MSG); } 101 #define CATCH_COMMON_ERR() catch(const StApi::CStGenTLErrorException &x) \ 103 RETURN_ERR(x.GetError(), x.GetDescription());\ 105 catch(GenICam::GenericException &x)\ 107 RETURN_ERR(GENICAM_ERROR, x.GetDescription());\ 112 RETURN_ERR(UNKNOWN_ERROR, UNKNOWN_ERROR_STR); 121 StApi::IStRegisteredCallbackReleasable *
cb_;
134 typedef std::map<std::string, GenApi::INode*>
MapChunk;
161 const std::string &camera_namespace,
186 void eventSystemCB(StApi::IStCallbackParamBase *p,
void *pvContext);
195 void eventInterfaceCB(StApi::IStCallbackParamBase *p,
void *pvContext);
204 void eventDeviceCB(StApi::IStCallbackParamBase *p,
void *pvContext);
216 void eventGenApiNodeCB(GenApi::INode *p,
void *pvContext);
227 void eventDataStreamCB(StApi::IStCallbackParamBase *p,
void *pvContext);
236 bool readNodeCallback(omronsentech_camera::ReadNode::Request &req,
237 omronsentech_camera::ReadNode::Response &res);
246 bool readNodeBoolCallback(omronsentech_camera::ReadNodeBool::Request &req,
247 omronsentech_camera::ReadNodeBool::Response &res);
256 bool readNodeEnumCallback(omronsentech_camera::ReadNodeEnum::Request &req,
257 omronsentech_camera::ReadNodeEnum::Response &res);
266 bool readNodeIntCallback(omronsentech_camera::ReadNodeInt::Request &req,
267 omronsentech_camera::ReadNodeInt::Response &res);
276 bool readNodeFloatCallback(
277 omronsentech_camera::ReadNodeFloat::Request &req,
278 omronsentech_camera::ReadNodeFloat::Response &res);
287 bool readNodeStringCallback(
288 omronsentech_camera::ReadNodeString::Request &req,
289 omronsentech_camera::ReadNodeString::Response &res);
298 bool writeNodeCallback(
299 omronsentech_camera::WriteNode::Request &req,
300 omronsentech_camera::WriteNode::Response &res);
309 bool writeNodeBoolCallback(
310 omronsentech_camera::WriteNodeBool::Request &req,
311 omronsentech_camera::WriteNodeBool::Response &res);
321 bool writeNodeEnumIntCallback(
322 omronsentech_camera::WriteNodeEnumInt::Request &req,
323 omronsentech_camera::WriteNodeEnumInt::Response &res);
333 bool writeNodeEnumStrCallback(
334 omronsentech_camera::WriteNodeEnumStr::Request &req,
335 omronsentech_camera::WriteNodeEnumStr::Response &res);
344 bool writeNodeIntCallback(
345 omronsentech_camera::WriteNodeInt::Request &req,
346 omronsentech_camera::WriteNodeInt::Response &res);
355 bool writeNodeFloatCallback(
356 omronsentech_camera::WriteNodeFloat::Request &req,
357 omronsentech_camera::WriteNodeFloat::Response &res);
366 bool writeNodeStringCallback(
367 omronsentech_camera::WriteNodeString::Request &req,
368 omronsentech_camera::WriteNodeString::Response &res);
377 bool executeNodeCallback(
378 omronsentech_camera::ExecuteNode::Request &req,
379 omronsentech_camera::ExecuteNode::Response &res);
387 bool enableChunkCallback(
388 omronsentech_camera::EnableChunk::Request &req,
389 omronsentech_camera::EnableChunk::Response &res);
397 bool enableTriggerCallback(
398 omronsentech_camera::EnableTrigger::Request &req,
399 omronsentech_camera::EnableTrigger::Response &res);
407 bool enableEventNodeCallback(
408 omronsentech_camera::EnableEventNode::Request &req,
409 omronsentech_camera::EnableEventNode::Response &res);
417 bool enableImageAcquisitionCallback(
418 omronsentech_camera::EnableImageAcquisition::Request &req,
419 omronsentech_camera::EnableImageAcquisition::Response &res);
427 bool enableEventAcquisitionCallback(
428 omronsentech_camera::EnableEventAcquisition::Request &req,
429 omronsentech_camera::EnableEventAcquisition::Response &res);
437 bool getImageAcquisitionStatusCallback(
438 omronsentech_camera::GetImageAcquisitionStatus::Request &req,
439 omronsentech_camera::GetImageAcquisitionStatus::Response &res);
447 bool getEventAcquisitionStatusListCallback(
448 omronsentech_camera::GetEventAcquisitionStatusList::Request &req,
449 omronsentech_camera::GetEventAcquisitionStatusList::Response &res);
457 bool getEventNodeStatusListCallback(
458 omronsentech_camera::GetEventNodeStatusList::Request &req,
459 omronsentech_camera::GetEventNodeStatusList::Response &res);
467 bool getChunkListCallback(omronsentech_camera::GetChunkList::Request &req,
468 omronsentech_camera::GetChunkList::Response &res);
476 bool getTriggerListCallback(
477 omronsentech_camera::GetTriggerList::Request &req,
478 omronsentech_camera::GetTriggerList::Response &res);
487 bool getEnumListCallback(omronsentech_camera::GetEnumList::Request &req,
488 omronsentech_camera::GetEnumList::Response &res);
497 bool getGenICamNodeInfoCallback(
498 omronsentech_camera::GetGenICamNodeInfo::Request &req,
499 omronsentech_camera::GetGenICamNodeInfo::Response &res);
508 bool sendSoftTriggerCallback(
509 omronsentech_camera::SendSoftTrigger::Request &req,
510 omronsentech_camera::SendSoftTrigger::Response &res);
517 bool getLastErrorCallback(
518 omronsentech_camera::GetLastError::Request &req,
519 omronsentech_camera::GetLastError::Response &res);
524 void initializeCameraInfo();
532 GenApi::INodeMap *getNodeMap(std::string &module_name);
541 MapCallback *getCallbackMap(std::string &module_name);
547 void publishEventDefault(omronsentech_camera::Event &msg);
ros::ServiceServer srv_write_node_int_
ros::ServiceServer srv_enable_image_acquisition_
StApi::IStRegisteredCallbackReleasable * cb_
ros::ServiceServer srv_read_node_string_
std::map< std::string, GenApi::INode * > MapChunk
ros::ServiceServer srv_write_node_
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val)
ros::ServiceServer srv_get_genicam_node_info_
ros::ServiceServer srv_read_node_float_
ros::ServiceServer srv_write_node_bool_
MapCallback map_event_localdevice_
bool bool_event_interface_
MapCallback map_event_remotedevice_
ros::ServiceServer srv_get_last_error_
ros::ServiceServer srv_write_node_enum_int_
ros::ServiceServer srv_send_soft_trigger_
ros::ServiceServer srv_enable_chunk_
StApi::CIStDataStreamPtr tl_ds_
image_transport::CameraPublisher it_campub_
bool bool_event_datastream_
ros::ServiceServer srv_enable_trigger_
MapCallback map_event_system_
ros::ServiceServer srv_enable_event_node_
ros::ServiceServer srv_get_event_acquisition_status_list_
ros::ServiceServer srv_get_enum_list_
bool bool_acquisition_is_started_
ros::ServiceServer srv_get_chunk_list_
ros::ServiceServer srv_write_node_string_
ros::ServiceServer srv_get_event_node_status_list_
ros::ServiceServer srv_read_node_bool_
ros::ServiceServer srv_write_node_float_
camera_info_manager::CameraInfoManager cinfo_
StApi::CIStDevicePtr tl_dev_
std::map< std::string, StCameraInterface * > MapCameraInterface
std::mutex mtx_acquisition_
ros::ServiceServer srv_read_node_int_
MapCallback map_event_datastream_
ros::ServiceServer srv_read_node_
ros::ServiceServer srv_enable_event_acquisition_
std::map< std::string, struct StCallback > MapCallback
ros::ServiceServer srv_read_node_enum_
Base class to control a connected camera.
ros::ServiceServer srv_get_trigger_list_
Class to handle ROS parameter.
ros::ServiceServer srv_get_image_acquisition_status_
image_transport::ImageTransport it_
Class to handle ROS parameter.
ros::ServiceServer srv_execute_node_
MapCallback map_event_interface_
ros::Publisher msg_chunk_
MapPublisher map_msg_event_
std::map< std::string, ros::Publisher > MapPublisher
ros::ServiceServer srv_write_node_enum_str_
std::string camera_namespace_