View Single Post
  #5   Spotlight this post!  
Unread 28-09-2011, 00:24
James Critchley James Critchley is offline
Registered User
no team
Team Role: Mentor
 
Join Date: Apr 2011
Rookie Year: 2010
Location: Lake Orion, Michigan
Posts: 45
James Critchley is an unknown quantity at this point
Re: Team 302's Off-Season Robotics Programming Competition

Your interpretation is correct.

My apologies, the discussion was intended to be an extension of the "getting started" documentation (to use the term "documentation" loosely) on VIRSYS.org. The prior version of the getting started page mentioned the configuration files... I just noticed it no longer does, so that would be a problem.

The top level architecture is simple, and being clear about what it is should go a long way.

A VIRSYS simulation is three components. Your software, the physics model, and the 3D visualization (image generator, IG).

These three components run independently and send and receive UDP (networking) packets between each other. Your software environment (LabVIEW) and the physics model send to and receive data from each other. The IG never sends data and only listens to (receives data from) the physics model. The IG can be absent and apart from no visuals, the simulation should run.


For convenience, the physics model and IG are packaged in a single multi-threaded executable (VIRSYS.EXE). However, the network type communication between them is still there. You can configure the executable using the various (commented) text files which VIRSYS.EXE comes with (unzipped in the same directory). For example, you can tell the executable not to run physics which is useful for various things including constructing multiple remote views of the same simulation (on remote computers).

The comments are not fabulous, so here's what you need to do to the file "virsysPhysics.txt" so that it sends out an additional IG message:

before:
Code:
VIRSYS (VIrtual Robot SYStem) - Physics model configuration file

50001			<- local receive port
127.0.0.1		<- LabView host
50002			<- LabView host port

1			<- Number of image generators

127.0.0.1		<- IG host (1)
50003			<- IG host port (1) ...  additional hosts repeat like this

robot.txt		<- robot config file

0.001			<- integration time step
0.01			<- I/O time step (data publication frequency)
after:
Code:
VIRSYS (VIrtual Robot SYStem) - Physics model configuration file

50001			<- local receive port
127.0.0.1		<- LabView host
50002			<- LabView host port

2			<- Number of image generators.  NOW 2!

127.0.0.1		<- IG host (1)
50003			<- IG host port (1) ...  additional hosts repeat like this

127.0.0.1		<- IG host (2)  ACTUALLY WE'RE SENDING THIS TO LABVIEW FOR DISPLAY
50004			<- IG host port (2)

robot.txt		<- robot config file

0.001			<- integration time step
0.01			<- I/O time step (data publication frequency)
Note that you can run LabVIEW on a different machine if you wish by changing the "LabView host" from the loopback localhost IP address 127.0.0.1 to an actual remote IP address. Of course LabVIEW then needs to know where to send it's data.

Of your original 3 steps, the first is taken care of.

Quote:
--I need to configure VIRSYS.exe (via an existing text file) to send data out on another channel/port
Yes, done.

Quote:
--I need to configure the LabVIEW program to read data on that channel/port
I would replace "configure the" with "write/modify the" Thankfully there is an example of exactly what you need to do already inside the LabVIEW Trainer. You just need to find it, copy and paste, and change a few parameters. It's pretty easy to find inside the "HW" block on the Main VI. You want to mimic the Sensor Read/Recv procedure with only minor changes. I recommend performing all of your activities inside a newly created block on the Main VI directly below the HW block. This will give it it's own execution thread. Don't forget to use 50004 as the port number for this and adjust the size of the array to accommodate the size of the new message (per my last post).

Code:
--I need to add code to the LabVIEW program in order to parse that data
Yes. Parsing is also shown in the Sensor Recv procedure. Your signals are still "singles" (floats)... All you need to do is index into the array and verify which is which.

Adding a front panel for display of this data would be a nice touch.