Log in

View Full Version : Python Vision Tracking


jacob9706
17-02-2013, 01:09
Here is a sample of what my team has done this season in terms of vision processing. All the code is available at https://github.com/Team3574/2013VisionCode

Any questions you have I will try to answer.

Moriarty
17-02-2013, 01:21
Very nice! I love pythons readability and it seems like a great idea to implement vision targeting in python. I assume you didn't program your whole robot in Python (or did you? (http://firstforge.wpi.edu/sf/projects/robotpy)).

Also: method Point.getTurple() -- Shouldn't it be getTuple?

jacob9706
17-02-2013, 01:23
Very nice! I love pythons readability and it seems like a great idea to implement vision targeting in python. I assume you didn't program your whole robot in Python (or did you? (http://firstforge.wpi.edu/sf/projects/robotpy)).

Also: method Point.getTurple() -- Shouldn't it be getTuple?

Yeah they did the robot in Java. I am working on Network Tables right now. Any ideas for that so I don't have to write my own? And yes, Ignore my spelling :P

PaulDavis1968
17-02-2013, 01:32
Yeah they did the robot in Java. I am working on Network Tables right now. Any ideas for that so I don't have to write my own? And yes, Ignore my spelling :P

Use the c++ versions of networktables on non robot side. Use SIP with python. Now you have network tables in Python. Look in the Python forum on here. It tells you how.

http://www.chiefdelphi.com/forums/showthread.php?t=111530

It is the same concept of using python wrapper around opencv as you did.

sjspry
17-02-2013, 16:29
I really appreciate an example in Python. A lot of people seem to think using multiple languages will be a problem, but the readability of your example might make them reconsider :)

I like it! My only complaint is that your use of accessor methods is very un-pythonic.

ohrly?
17-02-2013, 17:15
My team is doing something similar, and we ended up using a library called "py4j" to use the java network tables client provided by FIRST.

What are you using as a computer? And also, what is the frisbee tracking for?

sparkytwd
19-02-2013, 14:34
I'm another mentor for 3574, I posted our Python NT2 client here: http://www.chiefdelphi.com/forums/showthread.php?t=113955

Unfortunately we can't use the SIP wrapped libraries as this is running on an ARM platform (Odroid U2).

jacob9706
19-02-2013, 20:36
I really appreciate an example in Python. A lot of people seem to think using multiple languages will be a problem, but the readability of your example might make them reconsider :)

I like it! My only complaint is that your use of accessor methods is very un-pythonic.

Thanks. I am VERY new to Python. I realized that it is "un-pythonic" after I was finished. The main reason for doing so though was the sider's take an update method to call when changed, hence the setter methods.

As my mentor said we are using an ODROID-U2.

PaulDavis1968
23-02-2013, 19:05
I'm another mentor for 3574, I posted our Python NT2 client here: http://www.chiefdelphi.com/forums/showthread.php?t=113955

Unfortunately we can't use the SIP wrapped libraries as this is running on an ARM platform (Odroid U2).


I got SIP to build.

yehudaeitam
24-02-2013, 07:11
Nice, We also use python for image processing (Team 3211 from Israel).
Why are you not using UDP or TCP to transfer the data? It is very simple with python, and very simple to get the data in Java / LV..

PaulDavis1968
04-03-2013, 01:19
Nice, We also use python for image processing (Team 3211 from Israel).
Why are you not using UDP or TCP to transfer the data? It is very simple with python, and very simple to get the data in Java / LV..

But not in c++. (On the robot)