Go to Post This is a once in a life time event for many of you guys. ENJOY it! - Tom Line [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 04-10-2013, 10:18
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Using a Kinect as a primary camera for drivers

Hello! I was wondering how we would go about streaming images from a Kinect which is plugged into an on-board computer to the driver station. I've been looking at TCP (using C++, because we're using C++ OpenCV) for sending both targeting data (just three floating point numbers) and video, but I'm not entirely sure where to begin. What have other teams done? Do they use 3rd party TCP/UDP/___ libraries or do they write their own? I guess if all else fails we can use the Axis Camera for the driver and simply send targeting data to the cRIO via NetworkTables (or the C++ equivalent). It's bugging me. All the vision processing I've learned so far has just been on my personal computer, because I know that actually sending that information to the cRIO is going to be a challenge of it's own. Any thoughts on the matter would be greatly appreciated!
  #2   Spotlight this post!  
Unread 04-10-2013, 13:59
Invictus3593's Avatar
Invictus3593 Invictus3593 is offline
time you like wasting is not wasted
FRC #3593 (Team Invictus)
Team Role: Leadership
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Tulsa, OK
Posts: 318
Invictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really nice
Re: Using a Kinect as a primary camera for drivers

I've been working on C# code to get kinect depth camera and color camera and I've gotten success in recieving the feeds in an onoard computer, but I'm having trouble with networking as well.

I know TCP is the protocol used by the axis camera and the port it uses is 80.If you were going to use just the kinect and no axis camera, you could use port 80 for the data. If you needed another port, look in the manual for guidelines on which ones you can use and select one that is bidirectional, same as 80.

If you can't write your own TCP libraries, i'd definitely find a third-party client to work with.

Hopefully this helps!
__________________
Per Audacia Ad Astra
  #3   Spotlight this post!  
Unread 04-10-2013, 15:01
curtTheGreat curtTheGreat is offline
Registered User
FRC #0930
 
Join Date: Jan 2013
Location: Wisconsin
Posts: 1
curtTheGreat is an unknown quantity at this point
Re: Using a Kinect as a primary camera for drivers

Last year when we used a Kinect sensor, we ran into some troubles with a network based solution. That being said we chose to use the serial port on our CRio. Going serial allowed us to get an uninterrupted signal from our onboard computer to the CRio.
  #4   Spotlight this post!  
Unread 04-10-2013, 15:26
Domtech's Avatar
Domtech Domtech is offline
I Do Everything
AKA: Dominic
FRC #2412 (Robototes)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2004
Location: Bellevue WA
Posts: 46
Domtech is an unknown quantity at this point
Re: Using a Kinect as a primary camera for drivers

I played around with using the kinect as a driver camera last year, and I managed to get it working with just some of the shelf freeware:

1. KinectCam, a driver to make the kinect work as a USB webcam.

2. yawcam, a small aplication to host the camera feed over the network.

It worked quit well, but at about a second of lag with the classmate on the robot transmitting over wifi, it was too slow to be useful, and we didn't have any weight allowance left.

Cool part is that KinectCam was able to place a BMP crosshair at a certain "depth" into the image, which was great for aiming.
  #5   Spotlight this post!  
Unread 04-10-2013, 22:26
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Using a Kinect as a primary camera for drivers

There are numerous threads asking how to communicate between devices on the robot.

I've attached an image to show how the networking can be accomplished in LV.

The TCP and UDP icons are in the Data Communication/Protocols directory. When you don't need to receive all data, and are sending smallish amounts, I prefer to use UDP. It is really simple to use. You need to identify how to encode the data. You can use json, xml, or flattened binary. Just have the read side match and have it check for timeout errors.

TCP is similar -- but different. Large amounts of data, above a few Kbytes will typically use TCP instead of UDP, and if you are sending a protocol where all elements must be processed in order, TCP is your friend.

Greg McKaskle
Attached Thumbnails
Click image for larger version

Name:	Clipboard 1.png
Views:	126
Size:	106.9 KB
ID:	15263  
  #6   Spotlight this post!  
Unread 04-10-2013, 23:18
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Using a Kinect as a primary camera for drivers

Quote:
Originally Posted by Greg McKaskle View Post
I've attached an image to show how the networking can be accomplished in LV.
[small, elegant LabView code]
sigh... I really hope it turns out to be like that in C++... or even Java. Actually it wouldn't be too much of a learning stretch (formatting wise) to use java.
  #7   Spotlight this post!  
Unread 06-10-2013, 21:30
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Talking Re: Using a Kinect as a primary camera for drivers

Quote:
Originally Posted by Domtech View Post
I played around with using the kinect as a driver camera last year, and I managed to get it working with just some of the shelf freeware:

1. KinectCam, a driver to make the kinect work as a USB webcam.

2. yawcam, a small aplication to host the camera feed over the network.

It worked quit well, but at about a second of lag with the classmate on the robot transmitting over wifi, it was too slow to be useful, and we didn't have any weight allowance left.

Cool part is that KinectCam was able to place a BMP crosshair at a certain "depth" into the image, which was great for aiming.
This post just solves half the problems that I am having with OpenCV and hacking the kinect
  #8   Spotlight this post!  
Unread 08-10-2013, 21:12
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Using a Kinect as a primary camera for drivers

Quote:
Originally Posted by Invictus3593 View Post
I know TCP is the protocol used by the axis camera and the port it uses is 80.

[...] If you can't write your own TCP libraries, i'd definitely find a third-party client to work with.
Thanks! That really does help. I've been looking all over, and I've gotten the impression MJPEG just passed java by, and wasn't really picked up and developed by the java community (which makes finding useful resources a pain...). I've found great libraries for streaming straight JPG images via UDP, but I have a feeling that the DriverStation is pretty locked down and resistant to change. I've also found a few promising and "robust" third party TCP libraries, but I'm almost certain we would end up having to write our own program to encode the series of JPEG images to MJPEG video (I can't find info on this ANYWHERE). Are there any other options for streaming video through port 80 to the driver station (without creating a custom dashboard or something like that)? Thanks!
  #9   Spotlight this post!  
Unread 08-10-2013, 21:16
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Question Re: Using a Kinect as a primary camera for drivers

Since I am familiar with PHP, can I have nginx and php serve a file to the cRIO? How would I do this?
  #10   Spotlight this post!  
Unread 15-10-2013, 09:35
Invictus3593's Avatar
Invictus3593 Invictus3593 is offline
time you like wasting is not wasted
FRC #3593 (Team Invictus)
Team Role: Leadership
 
Join Date: Jan 2013
Rookie Year: 2010
Location: Tulsa, OK
Posts: 318
Invictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really niceInvictus3593 is just really nice
Re: Using a Kinect as a primary camera for drivers

Quote:
Originally Posted by ekapalka View Post
Thanks! That really does help. I've been looking all over, and I've gotten the impression MJPEG just passed java by, and wasn't really picked up and developed by the java community (which makes finding useful resources a pain...). I've found great libraries for streaming straight JPG images via UDP, but I have a feeling that the DriverStation is pretty locked down and resistant to change. I've also found a few promising and "robust" third party TCP libraries, but I'm almost certain we would end up having to write our own program to encode the series of JPEG images to MJPEG video (I can't find info on this ANYWHERE). Are there any other options for streaming video through port 80 to the driver station (without creating a custom dashboard or something like that)? Thanks!
If you're trying to use the driver station to connect, it is gonna be locked down, but the dashboard isn't. If you need help programming a custom dashboard, there are white papers all over the internet that can help or you can post in NI Labview!

If you're completely shut down to the custom dashboard idea, you can try writing a seperate program that you can run on the driver computer that only gets what you need from the stream, but I don't think it would be easily integrated into driver-side vision processing.
__________________
Per Audacia Ad Astra
  #11   Spotlight this post!  
Unread 20-10-2013, 11:25
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: Using a Kinect as a primary camera for drivers

If NI redesigns the driver station with the new control system, it would be a great idea to add an SDK for the driver station; in other words, they should allow macros, scripts and ability to add controls to the driver station
  #12   Spotlight this post!  
Unread 20-10-2013, 19:28
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,751
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Using a Kinect as a primary camera for drivers

Can you explain what you mean by "add controls"?

Greg McKaskle
  #13   Spotlight this post!  
Unread 20-10-2013, 20:22
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: Using a Kinect as a primary camera for drivers

Yes, sir, indeed.
What I mean by controls is add features to it, like multiple cameras, or buttons within the driver station or anything else you could possibly think of
  #14   Spotlight this post!  
Unread 20-10-2013, 21:19
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
Re: Using a Kinect as a primary camera for drivers

Quote:
Originally Posted by Greg McKaskle View Post
Can you explain what you mean by "add controls"?
You seem like the right person to go about making suggestions to regarding the DriverStation. What I want is a full-fledged DriverStation SDK that gives programmers straightforward and simplistic control over the entire atmosphere (not only the SmartDashboard, but the look and feel of the DriverStation app, as well). Also easy two way control between the DriverStation and an onboard computer. What I'd really love would be to have things like dynamic apps that can change depending on the task and non-standard I/O, custom buttons, custom sliders, particle affects, colour changing text, OpenGL simulations, realtime graphs, and simple video streaming procedures for non-IP cameras. I think I've set my expectations wayy too high :P I would at least like a change of DriverStation colours... I always feel like I'm using Windows 98... I'm so sorry for complaining... I'm just working on a custom dashboard, and I've set a lot of really high goals... thanks!
  #15   Spotlight this post!  
Unread 20-10-2013, 21:34
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: Using a Kinect as a primary camera for drivers

I will have to agree with that. I think that that is one of the "dreams" of many Driver Station users
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:12.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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