|
RoboRio Port Info Pete from United States [56 posts] |
9 year
|
Hi STeven,
Here is information on the ports used by the roboRio, using the HTTP_read with a USB camera I do not think will work as the USB camera sends data on port 1180.
Communication between the ROBOT and the OPERATOR CONSOLE is restricted as follows:
A. Network Ports:
1. TCP 1180: Camera data from the roboRIO to the Driver Station (DS) when the camera is connected the roboRIO via USB, bi-directional.
2. TCP 1735: SmartDashboard, bi-directional
3. UDP 1130: Dashboard-to-ROBOT control data, uni-directional
4. UDP 1140: ROBOT-to-Dashboard status data, uni-directional
5. HTTP 80: Camera connected via switch on the ROBOT, bi-directional
6. HTTP 443: Camera connected via switch on the ROBOT, bi-directional
7. UDP/TCP 554: Real-Time Streaming Protocol for h.264 camera streaming, bi-directional
8. UDP/TCP 5800-5810: Team Use, bi-directional
Teams may use these ports as they wish if they do not employ them as outlined above (i.e. TCP 1180 can be used to pass data back and forth between the ROBOT and the DS if the Team chooses not to use the camera on USB).
B. Bandwidth: no more than 7 Mbits/second.
Thanks,
-pete
|
|
|
Steven Gentner from United States [1446 posts] |
9 year
|
Pete,
While this is interesting the port number is only a small part of the issue. The bigger issue is what format the data is coming over in those ports. You can always access a different port than port 80 in HTTP simply by specifying the port (i.e. http://localhost:1180/) but the real question is how that data is formatted coming over that port. You can try an experiment and enter in http://my_robo_rio_ip_address:1180/ and see what happens in a browser. I suspect that it might not be something a browser can interpret but if you do get something post the first part of the data here and we can perhaps understand what format is coming from that port.
Note, the USB camera is NOT transmitting any data over the network. It will be the RoboRio that acts like a relay from the USB camera so you are not talking directly to the camera but to the RoboRio. We do the same thing with our Distributor Client/Server where the image captured from a USB camera can be translated into an IP type format that can be sent elsewhere. We do have the previous versions of that MS camera and its just a regular USB camera. That's the main difference between the Axis and this one. The Axis was its own little computer that would send image data out over the network. USB cameras do not do this but instead just send data of the USB cable to a host computer. The host computer can than chose what to do with this data but the camera does not natively send any data over the network.
So what we are looking for is what services the RoboRio is offering in terms of sending image data. The dashboard requires at least one of these to get the image. That's the service we are interested in.
STeven.
|
|
|
Pete from United States [56 posts] |
9 year
|
Hi STeven,
In response to your last question you had sent me, yes we have been able to use the sample vision program with the USB camera and get video on the driver station dashboard. Does that give you a clue on how to get into RR
We have not been able to figure out how to get to RR.
Thanks,
-pete
|
|
|
Steven Gentner from United States [1446 posts] |
9 year
|
Pete,
That's good ... but can you post what that code is here or a link on the wpilib site that we can download? I've got no idea what the code is that they are referring to on the Delphi site (again, we have very VERY little contact with FIRST so we're a bit blind here).
Thanks,
STeven.
|
|
|
Pete from United States [56 posts] |
9 year
|
Here is the Sample vision code C++ file.
This is the code that works to display the USB camera video to the dashboard.
#include "WPILib.h"
/**
* Uses the CameraServer class to automatically capture video from a USB webcam
* and send it to the FRC dashboard without doing any vision processing. This
* is the easiest way to get camera images to the dashboard. Just add this to the
* RobotInit() method in your program.
*/
class QuickVisionRobot : public SampleRobot
{
public:
void RobotInit() override {
CameraServer::GetInstance()->SetQuality(50);
//the camera name (ex "cam0") can be found through the roborio web interface
CameraServer::GetInstance()->StartAutomaticCapture("cam0");
}
void OperatorControl()
{
while (IsOperatorControl() && IsEnabled())
{
/** robot code here! **/
Wait(0.005); // wait for a motor update time
}
}
};
START_ROBOT_CLASS(QuickVisionRobot);
My guess is you may need to see what is in the WpiLib code, let me look around for that as I have not looked at any of the library code this year.
Thanks,
-pete
|
|
|
Pete from United States [56 posts] |
9 year
|
Attached are the include .h files for the CameraServer and the USBCamera.
-pete
|
|
|
Pete from United States [56 posts] |
9 year
|
|
|
Pete from United States [56 posts] |
9 year
|
|
|
Steven Gentner from United States [1446 posts] |
9 year
|
Pete,
The zip just had the header files (.h) and was missing the .cpp files. Its looks encouraging as the header file seems to work with mjpeg formatted images which is what would be streamed just like last year. If we can see the .cpp that would confirm it.
The other teams vision processing is great ... but they are running this directly on the RoboRio and therefore access the USB camera directly (/dev/video0) which is expected if you are on the machine.
STeven.
|
|
|
Pete from United States [56 posts] |
9 year
|
Hi STeven,
With some searching and some questions on the FIRST forum I have found the source files and have attached here, left me know if you need additional files.
Thanks,
-pete USBCamera.zip
|
|
|
Steven Gentner from United States [1446 posts] |
9 year
|
Pete,
Thanks for that file. I seems that they are using jpeg images but with a couple bytes at the beginning of the stream that indicate size, fps, etc. Its not a standard stream format so we'll have to create something specific to handle these kinds of streams. Would you be willing to work with us to test this out? I.e. we really want to be sure at least one team would use something like this before going to the trouble of writing something that is custom and specific to FRC that will probably only work for this season as they will change things again next season.
Thanks,
STeven.
|
|
|
Peter Estelle from United States [6 posts] |
9 year
|
Our FIRST team would very much like to use RoboRealm. We have used the Axis IP camera in the past with great success. But the camera is $160-250 depending on vendor. We would very much like to use the $25 - 30 MS LifeCam HD-3000 that plugs into the USB port on the roboRIO if it is possible. (It's V4L compatible) We were dismayed to discover we might not be able to use this tool that we have come to rely on.
I'd be willing to help test it. I am mentoring another team that would like to do use it as well. If you can manage to make this work, I'd gladly post it on the Chief Delphi forum. There are a tremendous number of potential users there.
Sincere thanks for RoboRealm and your sponsorship of FIRST. I love using it. It's a great tool to introduce high school students to what can be a difficult topic to high - especially when I am not a vision professional myself.
Regards,
Mentor Pete (different from -pete in previous posts)
|
|
|
Anonymous |
9 year
|
Hi STeven,
Yes, I would definetly be willing to help out and test getting a USB video feed from the roboRio controller into RoboRealm. This year the controller is new which allows connecting a USB camera to the controller. Information on the new controller can be found here https://decibel.ni.com/content/docs/DOC-30419. This controller I believe will be used for the next several years, the previous controller did not have a USB interface. As mentioned in the previous post by Mentor Pete there are many teams that are trying to use this camera and I see this for several years to come.
As you are aware we only have 6 weeks to complete a robot and we are at the half way point. If we can get something working in the next week or so would be a big help for teams. Our team would also be using during the off season. Thanks for any support.
If you need further information or additional files please let me know.
Thanks,
-pete
|
|
|
Steven Gentner from United States [1446 posts] |
9 year
|
Pete(s),
Thanks for the info. We're not as much concerned about the hardware as we are the software. Since its easier to change the software framework each year, that typically happens which means there could even be an update in a couple weeks that would change the communication format. We see evidence of additional un-yet implemented features (specifically to do with compression) that seem to be still in flux. Regardless, we'll move forward and see if we can keep up with the changes. Note, we don't get informed of these changes so if things suddenly stop working after an update ... well, that would not be surprising.
So, in the most recent version (as of in the last 15 min) there is now a FRC_CameraClient module built specifically to communicate with the CameraServer. As this has NOT been tested I don't expect this to work so keep in mind that we're still testing things.
If you can download the latest version and give this module a try that would be great. You should only need to change the IP address and press Start. Most likely you will get a crash. Allow that to happen and then restart RR. Send us the Crash file request that will popup so that we can take a further look.
Note, there is some doubt (cause we don't have all the code) as to even IF the camera server can support more than one connection. It doesn't seem so ... so when doing this initial testing PLEASE make sure that the dashboard is NOT running. If everything seems OK, try turning on the dashboard and see what happens. I would expect one or the other to work but not both RR and the Dashboard ... but maybe we get lucky.
Happy testing!
STeven.
|
|
|
Peter Estelle from United States [6 posts] |
9 year
|
STeven -
Thanks so much! We got it working. This is great news for us, for "pete" and other teams! But only for one connection at a time as you suspected.
But we'll take RoboRealm over the other stuff any day!
Sincere thanks and regards,
Mentor Pete
FRC Team 1683
|
|
|
Steven Gentner from United States [1446 posts] |
9 year
|
Pete,
A trick from the previous years can even solve the one connection issue. Once the image is in RR, you can activate the Webserver in RR (Options button->Webserver tab) and then point the dashboard to a local url http://localhost:8080/ which will look like an Axis camera to the dashboard. (You can even do that using a browser...) Or you can use the Virtual Webcam to stream the image to other environments that expect a webcam image. Lots of possibilities.
STeven.
|
|
|
Peter Estelle from United States [6 posts] |
9 year
|
STeven -
Thanks for the great tip about the webserver and Virtual Webcam. I had seen those features before, but am not certain I would havve thought to use them for this purpose.
Thanks also for your support of the FIRST Robotics Competition with such a speedy implementation of a new feature for our needs!
And thanks to Pete T. who kicked off this thread and provided all the background info.
Pete
|
|
|
Anonymous |
9 year
|
Hi STeven,
I see Mentor Pete had updated on his progress, I meant to update last night after our meeting but it was a long day.
In summary,
- updated Roborealm software
- selected the FRC Camera module
- Host is now set by name as the radio this year is handing out IP's. So you would enter roborio-xxxx.local where xxxx is you team number. The name is handled by the nDNS process where is part of the driver station software load.
- The roborio was programed to enable the USB camera feed.
- The image feed was live in roborealm, no software crash
- It just worked.
Thanks for your support. I don't foresee changes in the USB camera software in the near future, just my opion.
Thanks,
-pete
|
|
|
Tony from United States [2 posts] |
9 year
|
Hello Steven,
My team and I have been attempting to use RoboRealm to process images from the USB camera through the FRC Camera Server plugin/option. However, we are unable to get a live capture whatsoever, or no frames. Interestingly enough, we are able to view live footage via the FRC PC Dashboard, but not on RoboRealm. In addition, occasionally when we try to view footage on RoboRealm we get a notification along the lines of "Improper JPEG format detected." We are not running the dashboard feed and RoboRealm at the same time, but once again, we are unable to get the feed on RoboRealm. Any suggestions or advice would be well received.
Thank you in advance
-Tony
|
|
|
from United States [3 posts] |
9 year
|
Hi Steven,
My team has had a similar problem. Our robot code is written in Java, and our attempts to connect to the USB cameras through the FRC_CameraServer module have failed. We have tried multiple computers, and RoboRio settings, but haven't got anything better that the "Invalid JPEG format detected" message. The Dashboard receives the same video feed perfectly. Turing off the dashboard doesn't seem to fix the problem.
Thanks,
NT
|
|
|
Pete from United States [56 posts] |
9 year
|
Hi Tony/NT,
Just wondering if you are using the same USB camera, the Microsoft HD-3000.
-pete
|
|
|
from United States [3 posts] |
9 year
|
Hi Pete,
Yes. Our team is using the HD-3000.
Thanks,
NT
|
|
|
Steven Gentner from United States [1446 posts] |
9 year
|
Tony & NT,
Do you happen to have the source code for what you are installing on the robot? Its very possible that the version you have is slightly different than what we built the module against. Since others have successfully used the module but you are having issues that is the most likely cause. The other possibility is that you'd need to update your code to the latest version (assuming that's what we had seen). Let me know if that doesn't make a difference.
|
|
|
Tony from United States [2 posts] |
9 year
|
About a day after my comment, we were able to get the feed into RoboRealm, sorry for not updating you, whoops. Thank you for responding to my comment, though. Once again, sorry for not letting you know that we resolved the problem.
|
|
|
from United States [3 posts] |
9 year
|
Hi,
Our team is still having issues with the camera feeds. Could you tell us how you fixed the problem?
Thanks,
NT
|
|
|
Gear It Forward (Team 2338) from United States [2 posts] |
9 year
|
Hi,
Our team is having a problem very similar to that of Tony's. We use a Microsoft Lifecam HD-3000. Our robot is programmed in Java, and we were able to view live footage on SmartDashboard by using the sample vision code (Java) provided by WPILib (very similar to the sample vision code posted by Pete above). Using RoboRealm's FRC CameraClient module, we set the IP address to that of the roborio (roborio-2338.local), the port number as 1180, and left other options untouched. After pressing Start, the frame count stays at 0 and time elapses (no crash whatsoever). Interestingly enough, the module worked only once and we were able to obtain a live camera feed on RoboRealm AND SmartDashboard at the same time. However, after we pressed stop, the module has never worked since that time, even with the same settings. After many tests including restarting the driver station computer, closing SmartDashboard, and changing port numbers, there is still no success.
Any suggestions on how to fix this problem? The six-week build season is about to come to an end, and it would be nice to be able to process images using RoboRealm instead of simply having a live camera feed.
|
|
|
Steven Gentner from United States [1446 posts] |
9 year
|
You can try downloading the latest version which has a couple more debugging statements that might help. You should try:
1. Once you have the image on SmartDashboard, quit that before checking with RR. From your description it seems like the connection is made but with no response from the server. I realize that it seemed to work once but try again without more than one connection to the server.
2. We've had other reports of folks having network connection issues with the network tables. They reimaged their roborio and that seemed to help this out. Not sure if that would pertain to you but as a last resort.
3. Always check the network connection by pinging the roborio from the PC to see if you can actually get to the roborio. If you are familiar with telnet that can be a second test. Sometimes network parameters can change which cause previous connections to fail, esp. when DHCP is involved.
STeven.
|
|