33 #ifndef AVT_VIMBA_API_H 34 #define AVT_VIMBA_API_H 40 #include <sensor_msgs/Image.h> 59 ROS_INFO_STREAM(
"[Vimba System]: AVT Vimba System initialized successfully");
74 std::map<VmbErrorType, std::string> error_msg;
95 std::map<VmbErrorType, std::string>::const_iterator iter =
96 error_msg.find(error);
97 if ( error_msg.end() != iter ) {
100 return "Unsupported error code passed.";
107 vimba_frame_ptr->GetWidth(width);
108 vimba_frame_ptr->GetHeight(height);
109 vimba_frame_ptr->GetPixelFormat(pixel_format);
110 vimba_frame_ptr->GetImageSize(nSize);
115 std::string encoding;
149 ROS_WARN(
"Received frame with unsupported pixel format %d", pixel_format);
150 if (encoding ==
"")
return false;
153 VmbErrorType err = vimba_frame_ptr->GetImage(buffer_ptr);
164 <<
"]: Could not GetImage. " 178 for (CameraPtrVector::iterator iter = cameras.begin();
179 cameras.end() != iter;
186 std::string strModelname;
187 std::string strSerialNumber;
188 std::string strInterfaceID;
194 err = (*iter)->GetName( strName );
200 err = (*iter)->GetModel( strModelname );
203 ROS_ERROR_STREAM(
"[Could not get camera mode name. Error code: " << err <<
"]");
206 err = (*iter)->GetSerialNumber( strSerialNumber );
209 ROS_ERROR_STREAM(
"[Could not get camera serial number. Error code: " << err <<
"]");
212 err = (*iter)->GetInterfaceID( strInterfaceID );
215 ROS_ERROR_STREAM(
"[Could not get interface ID. Error code: " << err <<
"]");
225 ROS_WARN(
"Could not get cameras from Vimba System");
228 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
NetPointer< Frame, AVT::VmbAPINET::Frame > FramePtr
IMEXPORT VmbErrorType Startup()
std::vector< CameraPtr > CameraPtrVector
ROSCPP_DECL const std::string & getName()
bool frameToImage(const FramePtr vimba_frame_ptr, sensor_msgs::Image &image)
const std::string BAYER_GBRG8
VmbErrorType GetCameras(CameraPtrVector &cameras)
NetPointer< Camera, AVT::VmbAPINET::Camera > CameraPtr
const std::string TYPE_16UC3
#define ROS_DEBUG_STREAM(args)
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)
void listAvailableCameras(void)
const std::string TYPE_16SC1