How to understand a activity connect with muti-same-activities

I'm a newer to MSRS,so there are always questions about VPL,hope you can answer my question :-D

Also in the example of Sick LRF,part of the program like this:

-

-- |* Worker * |

|

| *SickLRF*| |* if ( ..... ) *| |* Worker * |

|

|* Worker * |

|* Worker *| -| if (name == "Right")| -| ... |

|* Worker *| -| if (name == "Left")| -| ... |

|* Worker *| -| if (name == "Center")| -| ... |

-

the SickLRF service conected with three same activities "Worker".

How this program runs.Can you tell me?

Thanks. Tan Wangda

[659 byte] By [HustWugui] at [2008-2-7]
# 1

Hi,

The information in the notification from the SickLRF service is posted to the worker activity 3 times. Each of these times uses different parameters.

In a sequential programming language this would be a little bit like...

Code Snippet

if (DistanceMeasurements.Length > 0)

{

Worker.ProcessLaser(0, DistanceMeasurements, 3 * DistanceMeasurements.Length / 8, 10, 8000, "Right");

Worker.ProcessLaser(3 * DistanceMeasurements.Length / 8, DistanceMeasurements, 5 * DistanceMeasurements.Length / 8, 10, 8000, "Center");

Worker.ProcessLaser(5 * DistanceMeasurements.Length / 8, DistanceMeasurements, DistanceMeasurements.Length, 10, 8000, "Left");

}

however, in VPL the messages are sent to the activity concurrently.

To see the parameters send in each message, just hover the mouse pointer over the connector.

Hope this Helps

Paul

PaulCRoberts at 2007-10-11 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Visual Programming Language...
# 2

Thanks Roberts , you are so kind and warmhearted,I have understood it , :-D,Can I ask another question ?

In this LRF example vpl program.I can't quite understand these following things:

1.What "Right","Left","Center" concretely means.In diagram,there are some int type of Left,Right,and Center.I think they're result of measurement.But what the unit of this number? cm ? mm ? or less?

2.Some parament transfer to Worker activity I don't understand:

Why "Limit" have different values,some are DistanceMeasurements.Length * 3 / 8,others are DistanceMeasurements.Length * 5 /8, The same as "Offset".

Thanks

Tan Wangda

HustWugui at 2007-10-11 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Visual Programming Language...
# 3

The Laser Range Finder that is used in this diagram is a simulated SickLRF configured to scan a 180 degree arc anti-clockwise from right to left. When the diagram receives a notification of a new scan from the SickLRF it contains an array of n distance readings where the 0th member of the array is the distance of an object 90 degrees right of the front of the robot, the nth member is the distance of an object 90 degrees left of the direction the robot is facing, the n/2 member therefore is the distance of an object dead ahead.

The distances are in mm

If we consider the direction that the robot is facing to be 0 degrees, right to be -90 degrees and left to be +90 degrees then the 3/8 and 5/8 values are used to divide the distance measurements into three zones,

-90 to -22.5 degrees - referred to as "Right"

-22.5 to 22.5 degrees - referred to as "Center" (a 45 degree arc centered on the direction the robot is facing)

22.5 to 90 degrees - referred to as "Left"

The ProcessLaser handler on the Worker activity searches through a range of values in an array to find the lowest non-zero value in the range. The Offset and Limit values describe the range within the array.

The diagram then has information as to the distance of the closest objects in the three arcs described above and uses that information to decide how the robot should move.

Hope this Helps

Paul

PaulCRoberts at 2007-10-11 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Visual Programming Language...
# 4

Thanks Paul,I'll write a short artical about this,I think many people at first time using MSRS can't understand

Tan Wangda.

HustWugui at 2007-10-11 > top of Msdn Tech,Microsoft Robotics Studio,Microsoft Robotics - Visual Programming Language...

Microsoft Robotics Studio

Site Classified