Go Back   VEX Forum > Community > General Forum

General Forum Open Discussion of the VEX Robotics System that can be answered by anyone. VEX Robotics Engineers will not answer questions posted here; see Official VEX Technical Support below.

Reply
 
Thread Tools
  #1  
Old 02-07-2012, 11:52 PM
vexbot's Avatar
vexbot vexbot is offline
Senior Member
 
Join Date: Jul 2006
Location: Independence, Missouri
Posts: 380
Images: 6
Question VEXpro - Communicating with external software

I hope this isn't a really stupid question, but I'm really having a hard time trying to figure this out:

How would a program on the VEXpro communicate with software running on your PC other than TerkIDE?

The reason that I'm asking is that I would like to add vision to my robot and learn image processing. I found a really easy to use vision software called RoboRealm http://www.roborealm.com and an article in the March/April issue of ROBOT Magazine about streaming video to your PC from a webcam with the VEXpro.

I just don't have any idea of how to pass the information from RoboRealm back to the VEXpro. I'm assumming that the TerkIDE would have to be open, but I'm not sure. The article mentioned something about the software for the project being able to do that, but I haven't figured out how to run it yet. It's a Java app.

Any help would really be appreciated
__________________
Allen

A former VEX Robotics Hobbyist
I miss it everyday!
Reply With Quote
  #2  
Old 02-08-2012, 12:23 AM
jpearman's Avatar
jpearman jpearman is offline
Senior Member
VEX # 8888
 
Join Date: Apr 2011
Location: Los Angeles
Posts: 2,848
Images: 2
Re: VEXpro - Communicating with external software

Not a stupid question, the VEXpro is running linux and you have Wifi so the most common way would be using TCP/IP. Start by looking into this - berkeley sockets

The VEXpro (or PC) will create a server, the other a client, the client talks to the server and they exchange information.

Edit.

I took a look at the roborealm website, here is an excerpt from some of their documentation. I highlighted some relevant parts.

Quote:
RoboRealm offers a complete API that can be used to control RoboRealm from external applications. The API communicates over a socket based XML protocol so that it can be used to access RoboRealm on the same machine or over a network. The API can be used to acquire images, send images to RoboRealm for processing, access variables, set variables, etc. Note that while RoboRealm plugins are used to extend RoboRealm the API is used to control it. The two differ in terms of who is in "charge". With the API your application is in charge, with plugins RoboRealm is in charge.
Reply With Quote
  #3  
Old 02-08-2012, 01:52 AM
Quazar's Avatar
Quazar Quazar is offline
Senior Member
 
Join Date: Aug 2007
Location: SF Bay Area
Posts: 1,231
Images: 16
Re: VEXpro - Communicating with external software

I've found this site to be a good hands-on primer to low-level network programming. The sample source posted there works on the VEXpro, and I've used similar code to communicate between the VEXpro and a Mac.

This doesn't cover the higher levels of protocol (like XML), but it will at least get you a basic stream of data going between a program on the Vex and a program on your PC.

Cheers,
- Dean
Reply With Quote
  #4  
Old 02-08-2012, 03:35 PM
vexbot's Avatar
vexbot vexbot is offline
Senior Member
 
Join Date: Jul 2006
Location: Independence, Missouri
Posts: 380
Images: 6
Re: VEXpro - Communicating with external software

Thank you both again for the help!

The RoboRealm software has a "sockets" interface module built in. I had looked at it along with others ones trying to see what I could use. I will give it another look. Maybe between it and the pdf file Quazar sent me a link to, I can get it working.

I really wish that I could get the software provided with the article I mentioned to work though. There were detailed instructions on creating the project for the VEXpro part on the TerkIDE, but as I said, nothing for running the Java app for the pc part. The article "did" mention the app allowing you to view the streaming video coming from the VEXpro, being able to send it to RoboRealm, and pass information back. I will have to take a close look at the files for the VEXpro too.

I wish I could attach a link to the article so you could look at it, but as far as I know it's not available online. I have included the software in hopes someone might be able to take a look at it along with this link to the instructions: http://find.botmag.com/031202 . There is also a "Readme" file, but it didn't really say too much.

I don't know if the best thing might be trying to contact the authors for help or if I should forget all about trying to use that software and just focus on trying to write my own. Any thoughts?
Attached Files
File Type: zip VEXpro Webcam.zip (131.5 KB, 47 views)
__________________
Allen

A former VEX Robotics Hobbyist
I miss it everyday!
Reply With Quote
  #5  
Old 02-08-2012, 10:28 PM
jpearman's Avatar
jpearman jpearman is offline
Senior Member
VEX # 8888
 
Join Date: Apr 2011
Location: Los Angeles
Posts: 2,848
Images: 2
Re: VEXpro - Communicating with external software

I don't know what you have tried already, I don't have a VEXpro but looked at the java code you attached. The code ran in eclipse and opened a window which presumably would show the video image. Did you try and run it in the eclipse IDE? If not you can download it from here. You need to have a java virtual machine installed to use it, if you do not have java, one source for it is here.

I'm attaching an executable jar file that you can run from the windows command line as follows.

java -jar watchVideo.jar --videoServer 192.168.0.99

replace the ip address with the address of your VEXpro, you should have the server already running but I cannot test that for you.

you can see the available options by running as

java -jar watchVideo.jar -h

hope this helps, I don't use java at all in my work but use the eclipse IDE for other development purposes.
Attached Files
File Type: zip watchVideo.jar.zip (31.4 KB, 37 views)
Reply With Quote
  #6  
Old 02-09-2012, 03:39 PM
vexbot's Avatar
vexbot vexbot is offline
Senior Member
 
Join Date: Jul 2006
Location: Independence, Missouri
Posts: 380
Images: 6
Smile Re: VEXpro - Communicating with external software

Quote:
Originally Posted by jpearman View Post
I don't know what you have tried already, I don't have a VEXpro but looked at the java code you attached. The code ran in eclipse and opened a window which presumably would show the video image. Did you try and run it in the eclipse IDE? If not you can download it from here. You need to have a java virtual machine installed to use it, if you do not have java, one source for it is here.

I'm attaching an executable jar file that you can run from the windows command line as follows.

java -jar watchVideo.jar --videoServer 192.168.0.99

replace the ip address with the address of your VEXpro, you should have the server already running but I cannot test that for you.

you can see the available options by running as

java -jar watchVideo.jar -h

hope this helps, I don't use java at all in my work but use the eclipse IDE for other development purposes.
I had tried to open the file several times and I kept getting an error message. I read the article again, checked for Java on my pc, downloaded and installed Java again, checked the internet for help, etc. I figured there was probably something that I missing so I decided to ask the forum for help. I didn't even think about trying the windows command line.

Why did you try running it in the eclipse IDE and how did you do that? I read the "readme" text file included with the software and I think it did say something about running the app on the IDE (TerkIDE for the VEXpro). That didn't make any sense to me though and I didn't know how to do that.

I don't know what version of the eclipse IDE you used, but if you could let me know what you did - I would really appreciate. I guess it's not really necessary since you included the jar file for me to run from the windows command line, but I would still like to know.

Thank you for all the help,
__________________
Allen

A former VEX Robotics Hobbyist
I miss it everyday!
Reply With Quote
  #7  
Old 02-09-2012, 05:40 PM
jpearman's Avatar
jpearman jpearman is offline
Senior Member
VEX # 8888
 
Join Date: Apr 2011
Location: Los Angeles
Posts: 2,848
Images: 2
Re: VEXpro - Communicating with external software

Quote:
Originally Posted by vexbot View Post
Why did you try running it in the eclipse IDE and how did you do that? I read the "readme" text file included with the software and I think it did say something about running the app on the IDE (TerkIDE for the VEXpro). That didn't make any sense to me though and I didn't know how to do that.
The readme file says the following

Quote:
Open the java app in eclipse or compile it. Run it with the parameter --videoServer <IP of VEXpro>. Default resolution is 160 x 120 px.
So as I have no way to compile the java I used eclipse.

The procedure is (more or less)

create a new project
import the client/watchServer directory
add the jargs.jar as an external library
run


Quote:
I don't know what version of the eclipse IDE you used, but if you could let me know what you did - I would really appreciate. I guess it's not really necessary since you included the jar file for me to run from the windows command line, but I would still like to know.

Thank you for all the help,
I downloaded eclipse for java as linked to in the previous post. Use the top file "Eclipse for Java developers"

Could you run the file I attached before? could you connect to the VEXpro?
Reply With Quote
  #8  
Old 02-10-2012, 12:27 AM
vexbot's Avatar
vexbot vexbot is offline
Senior Member
 
Join Date: Jul 2006
Location: Independence, Missouri
Posts: 380
Images: 6
Red face Re: VEXpro - Communicating with external software

I'm sorry, I feel really stupid - I should have re-read the readme file before I asked for help. When the information for the VEXpro was first posted, it said the eclipse IDE would be used for programming. The VEXpro actually uses the TerkIDE so when I read that - in my mind it's what I thought they meant. The article never mentioned needing any other software besides what you normally used for programming the VEXpro. When you said you used the eclipse IDE, I wasn't sure if you meant a version you could use to program the VEXpro with or the one for Java at the top of the list.

I had some time tonight and tried the exacutable jar file you sent me. After a few tries, I finally got the pop-up window. I didn't try the eclipse IDE though, I decided to just use the windows command line instead. I really didn't want to use anymore software than I had to.

I haven't tried the files for the VEXpro yet, this was the part I wasn't sure about. The files for the VEXpro seemed pretty straight forward with the instructions provided. I did take a chance to look them over though. Hopefully, I can try everything out soon and it will all work - maybe I will get a chance this weekend!
__________________
Allen

A former VEX Robotics Hobbyist
I miss it everyday!
Reply With Quote
  #9  
Old 02-13-2012, 07:23 PM
vexbot's Avatar
vexbot vexbot is offline
Senior Member
 
Join Date: Jul 2006
Location: Independence, Missouri
Posts: 380
Images: 6
Unhappy Re: VEXpro - Communicating with external software

Well, I'm beginning to think this project was way over my head. I tried getting everything working this weekend and the server software that's suppose to run on the VEXpro kept displaying this error message in the Console window:


ERROR opening V4L interface
: No such file or directory
Child's result=256...awaiting child's termination...
Child's result=256.......starting child
Child's result=256...awaiting child's termination...
ERROR opening V4L interface
: No such file or directory
Child's result=256......starting child
ERROR opening V4L interface
: No such file or directory
Child's result=256...awaiting child's termination...
Child's result=256...awaiting child's termination...


I checked the instructions which said in case of trouble:

6. If you don’t see the “waiting for video client” message, your webcam may need different program options. Launch a terminal, cd /opt/usr/bin, and run ./uvcsrvr –h. Look at the help for different options that may be appropriate. Read the README.txt in the watchVideo folder, which will contain the latest suggestions.


I tried this, but all I got was the following in the terminal window:

root@qwerk:/opt/usr/bin# run ./uvcsrvr -m
-sh: run: not found
root@qwerk:/opt/usr/bin# run ./uvcsrvr -h
-sh: run: not found


I re-read the article and the instructions for creating the project and tried quite a few times - creating the project, deleteing it, and re-creating it, but nothing worked. I didn't know if there was a problem using the webcam I bought - a Logitech C210 USB webcam, but the comments on one of the files says that it works with all Logitech UVC compatible webcams.

I don't have any idea what's wrong or how to get it working. I'm sure that there's something that I'm missing or don't understand. I figure the only way to get it working is if someone else tries it and sees what happens or to try contacting the authors of the article. I figured there might be a glitch or two, but I was really hoping that the software would work with out too much trouble.


Any thoughts?



__________________
Allen

A former VEX Robotics Hobbyist
I miss it everyday!
Reply With Quote
  #10  
Old 02-13-2012, 07:31 PM
jpearman's Avatar
jpearman jpearman is offline
Senior Member
VEX # 8888
 
Join Date: Apr 2011
Location: Los Angeles
Posts: 2,848
Images: 2
Re: VEXpro - Communicating with external software

Quote:
Originally Posted by vexbot View Post
root@qwerk:/opt/usr/bin# run ./uvcsrvr -m
-sh: run: not found
root@qwerk:/opt/usr/bin# run ./uvcsrvr -h
-sh: run: not found


Well you don't ned to type "run" just type

./uvcsrvr -h

when you are in the subdirectory where that executable is. (the ./ means current directory)

Let me read you post in detail later and try and help.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

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


All times are GMT -6. The time now is 01:41 AM.


VEX and VEX Robotics are trademarks or service marks of Innovation First International, Inc.
Copyright © 2002-2013. All Rights Reserved. VEX Robotics, Inc. is a subsidiary of Innovation First International, Inc.
All other product names/marks of others are the property of their respective owners.