![]() |
Network Tables
Yeah, I know everybody has asked for this before, but I really need a Network Tables library for C++. I'd used pynetworktables and had a fully functioning code with Python, but the latency while using an Axis IP cam (even while connected to my laptop's ethernet port) is too dang high! When I tried C++, it worked like a charm, but there's no network table implementation for sending simple values such as x and y coordinates. Network sockets are sort of intimidating, and I haven't the faintest on how to implement them on our DS (with C++ and the openCV library) and the robot (using java). I would be truly grateful if someone could send me a part of their sockets code, just to get an idea on how to code it.
Thanks in advance! :D |
Re: Network Tables
How high is the latency? We haven't had any significant problems with it, and all of our code is implemented in python (robot + image processing + custom dashboard).
|
Re: Network Tables
I'd reckon like 3 seconds of latency...my FPS is great, it's just that there has to be some problems with the buffer :(
Code:
import cv2Code:
Traceback (most recent call last):Any ideas? |
Re: Network Tables
I use this:
Code:
vc = cv2.VideoCapture() |
Re: Network Tables
Ok so I tried this:
Code:
import cv2Code:
Traceback (most recent call last):And yeah, I'd read somewhere that ffmpeg could sometimes be the source of the problem, but I'm on windows and haven't the faintest idea on how to compile from source... I'm very sorry Dustin if the problem is to obvious, but I've been struggling with this for weeks and my team REALLY needs it for the championships... |
Re: Network Tables
Sorry, I copy/pasted that incorrectly. You should remove the buffer from the vc.read() call for initial testing. buffer happens to be a python keyword, and I was using it as a variable, so I wasn't allocating a new image buffer each time. So it was actually something like...
Code:
|
Re: Network Tables
Yeaaaaah.....same error....
Code:
Traceback (most recent call last):Code:
import cv2 |
Re: Network Tables
Interesting. Don't pass it a capture buffer then, and see what happens.
|
Re: Network Tables
Wait, the error is on the imshow. Odd. What type/shape is the image?
Code:
print img |
Re: Network Tables
With or without buffer, there's a problem with the capture. retval returns false, and the img array returns None, so I can't print img.shape or img.type.
Code:
AttributeError: 'NoneType' object has no attribute 'shape' |
Re: Network Tables
Quote:
|
Re: Network Tables
Well, if Windows 8.1 or OpenCV doesn't include ffmpeg by default, then I should go and install it....
|
Re: Network Tables
Oh that's right! You have to copy the ffmpeg DLL to C:\Python27 for it to work correctly. It should be included with the opencv binary distribution. It's rather odd to me that they're separate. It'll be called something like 'opencv_ffmpeg2xx.dll'
|
Re: Network Tables
Quote:
|
Re: Network Tables
Quote:
Quote:
|
| All times are GMT -5. The time now is 02:32. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi