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
  #21  
Old 04-30-2012, 10:04 PM
vexbot's Avatar
vexbot vexbot is offline
Senior Member
 
Join Date: Jul 2006
Location: Independence, Missouri
Posts: 383
Images: 6
Re: VEXpro - Communicating with external software

Paul,

Thanks so much for your posts. I had tried to contact you earlier through the DPRGs general contact email for help, but never heard back from anyone.

I haven't really worked on the project since February. With the help of quasar and jpearman, I was finally able to get the video feed in Roborealm. That's as far as I was able to get though. I still hadn't figured out how to send information from Roborealm back to the VEXpro so I could access it and use it to control a robot.

I've learned a lot since I bought my VEXpro, but my programming skill set isn't anywhere near quasar's, jpearman's, or your's. I'm basically one of those people you referred to in your article who wouldn't have the skills to be able to program the VEXpro. I bought it because I was hoping to "grow" into it and because I wanted to be able to do things like the project in your article. There have been many times when I've thought that I should have just bought the Cortex and stuck with EasyC - a graphical block based C programming software.

Any help that you could give me would be great!
__________________
Allen

A former VEX Robotics Hobbyist
I miss it everyday!
Reply With Quote
  #22  
Old 05-01-2012, 06:19 AM
bouchier's Avatar
bouchier bouchier is offline
Junior Member
 
Join Date: Nov 2011
Location: Dallas, TX
Posts: 7
Re: VEXpro - Communicating with external software

Hi Allen,

I'm sorry you were unable to reach me through the DPRG email. I'll check & find out what's going on. FYI, you'll find me in the members list and can send email from there.

I'm glad you got video to Roborealm, but sorry you found it hard going. But never fear - there's nothing like learning by doing.

frameProcessor.java has 2 functions of interest:
frame2Roborealm() sends an image to Roborealm. Read the API section of the Roborealm docs to find out what it does.
getShapeData() gets the X & Y coordinates of the shape Roborealm found. Documented in the API section of Roborealm.

Look at the function getVisualHeading() in watchVideo.java for an example of how to send an image to Roborealm and get its coordinates back. Then you can use the X & Y location to decide which way to turn the robot.

This code runs on the laptop. If you want to run on VexPro, hang on a week - I'm working on getting vexPro to talk directly to Roborealm.

I assume you have a standard vex robot with a couple of wheel motors driven from VexPro - is that correct? And you want to seek to something using the camera?

Paul
Reply With Quote
  #23  
Old 05-02-2012, 10:10 PM
vexbot's Avatar
vexbot vexbot is offline
Senior Member
 
Join Date: Jul 2006
Location: Independence, Missouri
Posts: 383
Images: 6
Re: VEXpro - Communicating with external software

Hi Paul,

That's OK. I admit I was kind of disappointed at the time, but things happen. I just appreciate your help now.

Getting the video set up really wasn't too bad - jpearman helped me out a lot. He made an executable jar file of watchVideo for me, told me how to run it, and told me how to check to see if my VEXpro was seeing the webcam. While trying different things, I learned that I could actually get a command prompt and run watchVideo from the Terk IDE.

I looked at the those sections of the code, but I don't really understand how they work. If it runs on my laptop - how would I acess the information to control a robot?

Something that would run on the VEXpro allowing it to talk with Roborealm directly sounds great. That's what quasar and jpearman were trying to help me do when I decided to take a break. Quasar had provided a link to a document on socket communications with simple client and server program examples. I was also looking at the socket interface on Roborealm. When I contacted Roborealm, they were interested in this too. They had seen your article and said they would try working the purchase of a VEXpro into their budget.

I don't have a specific robot to control at the moment. Basically, I just wanted to be able to send video from the VEXpro to Roborealm, have it process the image and send whatever information I select back to the VEXpro, and then use it to control whatever robot I build. I was interested in both avoiding objects and seeking them using the video.

I just didn't know how to do that myself and when I saw the project in your article and it mentioned being able to do that - I thought this is great!
__________________
Allen

A former VEX Robotics Hobbyist
I miss it everyday!

Last edited by vexbot; 05-02-2012 at 10:13 PM. Reason: Spelling
Reply With Quote
  #24  
Old 05-05-2012, 12:21 AM
bouchier's Avatar
bouchier bouchier is offline
Junior Member
 
Join Date: Nov 2011
Location: Dallas, TX
Posts: 7
Re: VEXpro - Communicating with external software

I've built a couple of programs you might be interested in:
RRTest: runs the Roborealm API test from the VexPro
rrClient: sends images from a VexPro-connected webcam to roborealm and pulls back data about the shape from the Shape_Match module.

There's a sample .robo program in the directory.

They can be checked out of svn at:
http://svn.dprg.org/repos/dprg/VEXPro/trunk/rrTest
http://svn.dprg.org/repos/dprg/VEXPro/trunk/rrClient

There's a README.txt in each that tells how to build & run them.

rrClient is really what you were asking for: a way to determine the position of a recognized object on the vexpro, so you can control the robot to seek to it or something along those lines.

Post if you have questions.

Enjoy!

Paul
Reply With Quote
  #25  
Old 05-07-2012, 10:36 PM
bstag bstag is offline
Junior Member
 
Join Date: May 2012
Location: Keller
Posts: 5
Re: VEXpro - Communicating with external software

Maybe Paul can report back after the DPRG contest coming up on how well this works in a contest
Reply With Quote
  #26  
Old 05-15-2012, 05:47 PM
vexbot's Avatar
vexbot vexbot is offline
Senior Member
 
Join Date: Jul 2006
Location: Independence, Missouri
Posts: 383
Images: 6
Question Re: VEXpro - Communicating with external software

Quote:
Originally Posted by bouchier View Post
I've built a couple of programs you might be interested in:
RRTest: runs the Roborealm API test from the VexPro
rrClient: sends images from a VexPro-connected webcam to roborealm and pulls back data about the shape from the Shape_Match module.

There's a sample .robo program in the directory.

They can be checked out of svn at:
http://svn.dprg.org/repos/dprg/VEXPro/trunk/rrTest
http://svn.dprg.org/repos/dprg/VEXPro/trunk/rrClient

There's a README.txt in each that tells how to build & run them.
Thanks Paul!

I'm sorry it's been awhile. I haven't had a chance to try out the rrClient program yet, but I have been looking over the files trying to see how it works.


Quote:
Originally Posted by bouchier View Post
rrClient is really what you were asking for: a way to determine the position of a recognized object on the vexpro, so you can control the robot to seek to it or something along those lines.
That's one thing that I would like to do, but I really wanted something more generic. I was really hoping to be able to use any modules or variables I wanted. I was mainly interested in using RoboRealm to avoid obstacles and manuever around them.

Quote:
Originally Posted by bouchier View Post
Post if you have questions.
I'm not really sure how everything works, especially without trying it, but I have a few questions:


1). Is there any set up I need to do in RoboRealm?

I was wondering if I needed to setup/use their Socket Interface Module to communicate with your program or does your program handle everything?


2). How hard would it be to use another variable?

I saw the section of code in the RR_API.cpp file that gets the information from the Shapes Module, but further down I also saw some other code for reading and setting the value of a variable. This is just the first section of code I came across for reading a variable:

Code:
/*
Returns the value of the specified variable.
    name - input - the name of the variable to query
    result - output - contains the current value of the variable
    max - input - the maximum size of what the result can hold
*/
bool RR_API::getVariable(char *name, char *result, int max)
Will that read any variable that I set up in RoboRealm or is that for something different?

What is the code for setting the value of a variable used for? Can I set the value of a variable and have RoboRealm read it?

Code:
/*
Sets the value of the specified variable.
    name - input - the name of the variable to set
    value - input - contains the current value of the variable to be set
*/
bool RR_API::setVariable(char *name, char *value)

Any further assistance that you could give me would be great! I can follow some of the code, but most of it is over my head.
__________________
Allen

A former VEX Robotics Hobbyist
I miss it everyday!
Reply With Quote
  #27  
Old 05-15-2012, 06:09 PM
bstag bstag is offline
Junior Member
 
Join Date: May 2012
Location: Keller
Posts: 5
Re: VEXpro - Communicating with external software

Paul is on a business trip will let him know about your post. Which he may not answer till after ROScon this weekend.
Reply With Quote
  #28  
Old 05-21-2012, 09:23 PM
bouchier's Avatar
bouchier bouchier is offline
Junior Member
 
Join Date: Nov 2011
Location: Dallas, TX
Posts: 7
Re: VEXpro - Communicating with external software

Sorry for the slow reply.

Here's a video of me doing a 3-minute lightning talk on the work we're doing to integrate VexPRO with ROS down here at the Dallas Personal Robotics Group:
http://youtu.be/ThN2c0rXj3k

Jason challenged me to report how well Roborealm worked at Roborama contest the weekend before last. Here's a video of vexpro on Roomba seeking to an orange can:
http://youtu.be/1BjE6****vQ

OK - sorry but youtube gave me a URL with a swear word embedded in it, and the bulletin board is filtering it. Here it is spelled out. Type all the letters together and you should get it.
http://youtu.be/1BjE6F U c K vQ
Sorry for the swear word - it was youtube. First time this has happened.

It worked really well. Picked out the can & seeked right to it. rrclient is doing the video & depositing the parameters in shared memory, & a program that's also in the svn repository at the same location as rrclient, Roborama2012, is picking it up & doing the driving.

Quote:
Originally Posted by vexbot View Post
T
That's one thing that I would like to do, but I really wanted something more generic. I was really hoping to be able to use any modules or variables I wanted. I was mainly interested in using RoboRealm to avoid obstacles and manuever around them.
Hmm - the issue with obstacle avoidance is you have to be able to tell what's an obstacle, and how far away it is, so you can drive a sensible path. (The far-away wall is an obstacle if you drive far enough.) Absent depth sensing (e.g. Kinect & point cloud), you ought to think about sonar for obstacle detection.

Quote:

I'm not really sure how everything works, especially without trying it, but I have a few questions:


1). Is there any set up I need to do in RoboRealm?

I was wondering if I needed to setup/use their Socket Interface Module to communicate with your program or does your program handle everything?
Yes, go to the options, and select the API tab and enable the API. Also, you need to poke a hole in the firewall of the PC you run roborealm on, to allow it to connect. I use my work PC and found it had 2 firewalls; I had to allow port 6060 through both the MacAfee firewall and the Windows firewall. Test it by telneting from vexpro to your PC at port 6060. e.g.
# telnet <pc_ip_address> 6060
If it connects, then you're good. You might need to declare your network a home network. Google for instructions on firewalls

Quote:
2). How hard would it be to use another variable?

I saw the section of code in the RR_API.cpp file that gets the information from the Shapes Module, but further down I also saw some other code for reading and setting the value of a variable. This is just the first section of code I came across for reading a variable:

Code:
/*
Returns the value of the specified variable.
    name - input - the name of the variable to query
    result - output - contains the current value of the variable
    max - input - the maximum size of what the result can hold
*/
bool RR_API::getVariable(char *name, char *result, int max)
Will that read any variable that I set up in RoboRealm or is that for something different?
You can read any variable. Read the documentation for various items like filters & circle probe, & if it's a pipeline stage that gives answers, it will have a section at the bottom labeled "Variables" and will describe the variables that you can get. Just use the same technique I showed but call out the different variable name to get what you want.

Quote:
What is the code for setting the value of a variable used for? Can I set the value of a variable and have RoboRealm read it?

Code:
/*
Sets the value of the specified variable.
    name - input - the name of the variable to set
    value - input - contains the current value of the variable to be set
*/
bool RR_API::setVariable(char *name, char *value)
Yes, absolutely. You can have your program change parameters. I'm less familiar with that, and didn't find any components that list settings you can change, but probably didn't look in the right place.

Quote:

Any further assistance that you could give me would be great! I can follow some of the code, but most of it is over my head.
Google the function calls you don't understand. Ask me if there are overall aspects of the program you don't get - sometimes it's hard to see what someone's doing.

regards

Paul
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 07:43 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.