Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Team 254 Presents: CheesyVision (http://www.chiefdelphi.com/forums/showthread.php?t=128639)

Thad House 18-04-2014 19:31

Re: Team 254 Presents: CheesyVision
 
Quote:

Originally Posted by billbo911 (Post 1376087)
As much as I would like to say I can help, I can't.
The solution I posted here will not work! What I posted is a Socket Requester. What is needed is a Socket Receiver.

I have tried dozens of variations based on tutorials, and on-line NI help, but so far have not been able to find anything that will work with CheesyVision and LabView. I know it "should" be simple, but so far I have not found anything that will work.

That said, it could quite easily be my setup. I do not have access to a cRio, so I am using one laptop to run CheesyVision and another running the "receiver" vi in a standalone configuration.

If anyone has any insight in how to resolve this, PLEASE SPEAK UP!!

I was able to get it to work in LabVIEW by converting it to use pynetworktables.

http://www.chiefdelphi.com/forums/sh...9&postcount=54
Thats the link to my post with the download, and the pynetworktables can be found here
http://firstforge.wpi.edu/sf/frs/do/...ktables.2014_4
The variables can just be read using the SmartDashboard ReadBoolean Vi's.

apalrd 19-04-2014 11:44

Re: Team 254 Presents: CheesyVision
 
We got it to work in LV by switching to a UDP socket instead of a TCP socket (on port 1130).

CheesyVision side, we removed the retry and connection code and use sendto instead of send to send a UDP socket. A quick google search (on my phone while at MSC) helped with this.

On the LV side, we used a UDP Open and UDP Listen with a timeout of 0 in a While loop. When UDP Listen returns an error (timed out), we have some logic to use the last good byte recieved as the Cheesyvision byte, timestamp it, then calculate age (dt of timestamp), and report the byte and age to our code.

I don't have the exact code, I'll see if I can get it.

Total coding time was under 10mins in the pits. This was after an hour or so of fooling around with TCP.

billbo911 19-04-2014 11:48

Re: Team 254 Presents: CheesyVision
 
Quote:

Originally Posted by apalrd (Post 1376339)
We got it to work in LV by switching to a UDP socket instead of a TCP socket (on port 1130).

CheesyVision side, we removed the retry and connection code and use sendto instead of send to send a UDP socket. A quick google search (on my phone while at MSC) helped with this.

On the LV side, we used a UDP Open and UDP Listen with a timeout of 0 in a While loop. When UDP Listen returns an error (timed out), we have some logic to use the last good byte recieved as the Cheesyvision byte, timestamp it, then calculate age (dt of timestamp), and report the byte and age to our code.

I don't have the exact code, I'll see if I can get it.

Total coding time was under 10mins in the pits. This was after an hour or so of fooling around with TCP.


Excellent!

I will try to replicate this approach this morning.
Please post your code when you can! It will help tremendously if we can't get it dialed in.

billbo911 20-04-2014 18:50

Re: Team 254 Presents: CheesyVision
 
1 Attachment(s)
OK, Here is a LabView TCP Receiver.

I can't believe how easy it was!

All my struggles were because I had a minor misunderstanding of how my IDE (Notepad++) was interacting with the CheesyVision code and also the security settings in Win 8 were preventing me from testing this receiver. The CheesyVision code is solid. Now this vi works just as reliably with it.

alexander.h 21-04-2014 17:20

Re: Team 254 Presents: CheesyVision
 
Quote:

Originally Posted by billbo911 (Post 1376918)
OK, Here is a LabView TCP Receiver.

I can't believe how easy it was!

All my struggles were because I had a minor misunderstanding of how my IDE (Notepad++) was interacting with the CheesyVision code and also the security settings in Win 8 were preventing me from testing this receiver. The CheesyVision code is solid. Now this vi works just as reliably with it.

If I understand well, this is the exact same code with the exact same functionality ... just in Labview?

alexander.h 21-04-2014 17:29

Re: Team 254 Presents: CheesyVision
 
Quote:

Originally Posted by billbo911 (Post 1371529)
I LOVE IT!!

This year 2073 used a USB webcam on our bot to track the balls. It was implemented to assist the driver with alignment to balls when they were obstructed from his view or just too far away to easily line up.
We won the Inspiration in Control Award at both Regionals we attended because of it. If 254 can share their code, we can share the Labview receiver we used to help any team that can take advantage of it.
Set the IP of the receiver to that of your DS, the Port number to that set on line 72 of the code 254 provided, and set number of bytes to read to whatever you are sending. In the case of 254's code, that should be 1.

A quick look at the block diagram will make it obvious what to do.

Please ask any questions here so I can publicly answer them.

How I understand this : the Labview code tracks the ball according to the shape and colour? If so, that means you're able to make an order of operations to follow once it tracks down the ball? For example, track the ball, calculate the distance away from the ball, move forward the correct distance and collect the ball when it reaches the right distance from the ball?

billbo911 21-04-2014 19:10

Re: Team 254 Presents: CheesyVision
 
Quote:

Originally Posted by alexander.h (Post 1377400)
If I understand well, this is the exact same code with the exact same functionality ... just in Labview?

This code just receives the output from CheesyVision. You still need CheesyVision running on the DS.

alexander.h 21-04-2014 19:14

Re: Team 254 Presents: CheesyVision
 
Quote:

Originally Posted by billbo911 (Post 1377459)
This code just receives the output from CheesyVision. You still need CheesyVision running on the DS.

And how would one be able to do this?

billbo911 21-04-2014 19:22

Re: Team 254 Presents: CheesyVision
 
Quote:

Originally Posted by alexander.h (Post 1377463)
And how would one be able to do this?

Read the very first in this thread. Everything you need to know is there.

billbo911 21-04-2014 19:34

Re: Team 254 Presents: CheesyVision
 
Quote:

Originally Posted by alexander.h (Post 1377402)
How I understand this : the Labview code tracks the ball according to the shape and colour? If so, that means you're able to make an order of operations to follow once it tracks down the ball? For example, track the ball, calculate the distance away from the ball, move forward the correct distance and collect the ball when it reaches the right distance from the ball?

LabView is not involved except for driving the robot.
We used a USB webcam attached to a PCDuino. It wold track the balls based on color and shape. We also had a switch on the DS that allowed us to select to track Blue or Red.
We only used the "x axis" center of the ball to assist the driver with aligning to the ball. We never used the distance to the ball.

We feed the "x" value to LabView to be used to help the driver align.

alexander.h 21-04-2014 19:47

Re: Team 254 Presents: CheesyVision
 
Quote:

Originally Posted by billbo911 (Post 1377477)
LabView is not involved except for driving the robot.
We used a USB webcam attached to a PCDuino. It wold track the balls based on color and shape. We also had a switch on the DS that allowed us to select to track Blue or Red.
We only used the "x axis" center of the ball to assist the driver with aligning to the ball. We never used the distance to the ball.

We feed the "x" value to LabView to be used to help the driver align.

OK ... so for Cheesy Vision, there is almost nothing going in Labview. As for the ball tracker, couldn't I just get the alliance colour and send that as the colour to recognize instead of using a switch on the Driver Station?

JamesTerm 22-04-2014 12:51

Re: Team 254 Presents: CheesyVision
 
Quote:

Originally Posted by alexander.h (Post 1377485)
As for the ball tracker, couldn't I just get the alliance colour and send that as the colour to recognize instead of using a switch on the Driver Station?

There has been some talk about that... on this thread.


BTW... I like the .h in your name... I thought you were a c++ programmer. :)

alexander.h 22-04-2014 18:13

Re: Team 254 Presents: CheesyVision
 
Quote:

Originally Posted by JamesTerm (Post 1377758)
There has been some talk about that... on this thread.

Thanks for the link!

Quote:

Originally Posted by JamesTerm (Post 1377758)
BTW... I like the .h in your name... I thought you were a c++ programmer. :)

Ha ha ha ... No, it just symbolize's the initial of my last name : Hassler.

Skragnoth 23-04-2014 21:34

Re: Team 254 Presents: CheesyVision
 
Has anyone had any luck using cheesy vision on the playing fields at champs? It works perfectly for us in the pit, but it is not able to connect to the robot on the Newton playing field or the Newton practice field. We submitted a question to the FTA regarding whether they have port 1180 blocked but haven't gotten back to us yet.

Gregor 23-04-2014 23:33

Re: Team 254 Presents: CheesyVision
 
Quote:

Originally Posted by Skragnoth (Post 1378130)
Has anyone had any luck using cheesy vision on the playing fields at champs? It works perfectly for us in the pit, but it is not able to connect to the robot on the Newton playing field or the Newton practice field. We submitted a question to the FTA regarding whether they have port 1180 blocked but haven't gotten back to us yet.

We ran it fine on our practice match on Galileo field.


All times are GMT -5. The time now is 05:08.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi