Closed qbranchmaster closed 9 years ago
Hi @qbranchmaster! I think you're not the first to point that out. However, the step is defined as the full row lenght in bytes in sensor_msgs. And VIMBA API returns the whole image size in bytes from
vimba_frame_ptr->GetImageSize(nSize);
So, in order to calculate the number of bytes in one row, I needed the total size and the number of rows (the height). If you write that t_step equals to width you are asumming that each pixel occupies one byte.
Could you please print the values of size, step, width and height before one of these errors please?
I normally get these values: SIZE = 2764800, STEP = 1920, WIDTH = 1920, HEIGHT = 1440 After some random time I get these values: SIZE = 2758176, STEP = 1915, WIDTH = 1920, HEIGHT = 1440 and my application crashes.
The size is obtained from the image frame data received from the camera. If the number of bytes drops, it may be caused by lost packages in the network. I don't know if your camera is GigE, but I guess it is, so I'd like to know first how the camera is connected to the computer and if the network interface is completely dedicated to the camera. Could you check if, connecting the camera directly to the network card in the computer returns this same errors?
You are right. I am using GigE network card, but my PoE supply is only 100mb. Changing 100mb PoE to GigE PoE fixed the problem.
Fantastic @qbranchmaster! If you are careful with the bandwidth I'm sure your 100Mb PoE should also work. I'll close the issue now. Thanks for reporting!
The solution for people without 1Gbit PoE, is to reduce the stream_bytes_per_second
in the launchfile.
If you have a 100MBit ethernet, keep the sum of all stream_bytes_per_second
under 85MBits to avoid framedrop & malformed images.
I wrote my ros node, which subscribes /camera/image_raw topic. Sometimes I get error: "Image is wrongly formed: step < width * byte_depth * num_channels or 1917 != 1920 * 1 * 1". The same error I get in image_view node (http://wiki.ros.org/image_view). I changed this line of code: VmbUint32_t step = nSize / height; to: VmbUint32_t step = width; in VimbaROS::frameToImage() function (vimba_ros.cpp) and now everything works fine. What is the problem?