33 #ifndef AVT_VIMBA_API_H 34 #define AVT_VIMBA_API_H 39 #include <sensor_msgs/Image.h> 46 using AVT::VmbAPI::CameraPtr;
47 using AVT::VmbAPI::FramePtr;
64 ROS_INFO_STREAM(
"[Vimba System]: AVT Vimba System initialized successfully");
81 std::map<VmbErrorType, std::string> error_msg;
102 std::map<VmbErrorType, std::string>::const_iterator iter = error_msg.find(error);
103 if (error_msg.end() != iter)
107 return "Unsupported error code passed.";
112 switch (interfaceType)
131 return "Read and write access";
133 return "Only read access";
135 return "Device configuration access";
137 return "Device read/write access without feature access (only addresses)";
141 return "Undefined access";
144 bool frameToImage(
const FramePtr vimba_frame_ptr, sensor_msgs::Image& image)
149 vimba_frame_ptr->GetWidth(width);
150 vimba_frame_ptr->GetHeight(height);
151 vimba_frame_ptr->GetPixelFormat(pixel_format);
152 vimba_frame_ptr->GetImageSize(nSize);
157 std::string encoding;
223 ROS_WARN(
"Received frame with unsupported pixel format %d", pixel_format);
228 VmbErrorType err = vimba_frame_ptr->GetImage(buffer_ptr);
247 ROS_INFO(
"Searching for cameras ...");
253 for (
const auto& camera : cameras)
257 std::string strModelname;
258 std::string strSerialNumber;
259 std::string strInterfaceID;
269 err = camera->GetName(strName);
275 err = camera->GetModel(strModelname);
278 ROS_ERROR_STREAM(
"[Could not get camera mode name. Error code: " << err <<
"]");
281 err = camera->GetSerialNumber(strSerialNumber);
284 ROS_ERROR_STREAM(
"[Could not get camera serial number. Error code: " << err <<
"]");
287 err = camera->GetInterfaceID(strInterfaceID);
290 ROS_ERROR_STREAM(
"[Could not get interface ID. Error code: " << err <<
"]");
293 err = camera->GetInterfaceType(interfaceType);
296 ROS_ERROR_STREAM(
"[Could not get interface type. Error code: " << err <<
"]");
299 err = camera->GetPermittedAccess(accessType);
316 ROS_WARN(
"Could not get cameras from Vimba System");
321 ROS_WARN(
"Could not start Vimba System");
static bool fillImage(Image &image, const std::string &encoding_arg, uint32_t rows_arg, uint32_t cols_arg, uint32_t step_arg, const void *data_arg)
const std::string BAYER_GRBG8
IMEXPORT VmbErrorType Startup()
std::vector< CameraPtr > CameraPtrVector
ROSCPP_DECL const std::string & getName()
bool frameToImage(const FramePtr vimba_frame_ptr, sensor_msgs::Image &image)
std::string accessModeToString(VmbAccessModeType modeType)
const std::string BAYER_GBRG8
void listAvailableCameras()
VmbErrorType GetCameras(CameraPtrVector &cameras)
std::string interfaceToString(VmbInterfaceType interfaceType)
const std::string TYPE_16UC3
const std::string BAYER_BGGR8
#define ROS_INFO_STREAM(args)
const std::string BAYER_RGGB8
const std::string TYPE_32SC4
#define ROS_ERROR_STREAM(args)
std::string errorCodeToMessage(VmbErrorType error)
const std::string TYPE_16SC1