Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: VBScript help  (Read 2702 times)

0 Members and 1 Guest are viewing this topic.

nurul atiqah syazwani

    Topic Starter


    Newbie

    • Experience: Beginner
    • OS: Unknown
    VBScript help
    « on: May 08, 2012, 09:18:55 AM »
    Hello Everyone.

    I'm new here. my name is Nurul. Sorry for my bad english. I need a favor from all of u. [;)]
    Currently I am doing a project of landmark tracking AGV. I used Roborealm for the image processing. In my project there are 8 red shapes represents as landmark. All the landmarks are stick on the floor.

    in roborealm I use:
    1) Flatten module
    2)RGB Module
    3)Mean module
    4)shape matching module
    5)VBSCript module.

    Each of the shape landmarks are at their position or coordinate. the sequence and coordinate of the shape landmarks are:
    square (0, 0) -> circle (0, 100) -> triangle (0, 200) -> pentagon (100, 200) -> octagon (200, 200) -> cross (200, 300) -> hexagon (200, 400) -> star (200, 500)

    In this project the AGV are require to navigate based on this shape sequence.
    For example: when AGV at landmark square  coordinate (0, 0). The AGV must know current position at square and the AGV must know that AGV must move toward circle at coordinate (0, 100) no matter what. Incase there is other shape (e.g triangle or others) interrupt  the path from sqaure to circle, the AGV must ignore it because the AGV know that he must go toward circle no matter what. When AGV reach circle, AGV know that he already at landmark circle.

    This condition goes on same for others shape. When the AGV at cirlce, the AGV know that AGV must go toward triangle at coordinate (0, 200).   When AGV reach triangle AGV know that AGV position is at traingle, the AGV know that AGV must go toward pentagon at coordinate (100, 200).

    My problem now is I don't how to pogramming it in VBScript. [&o]
    bellow is what I have done in my VBScript. Hope everyone can help me. I'm dumb in programming. Thank You. :)
    -------------------------------------------------------------------------------------------------------------------
    shapeLabel = GetStrVariable("SHAPE_LABEL")

    if shapeLabel = "square" then
    coordinate_i = 0
    coordinate_j = 0
    next_shapelabel = "circle"

    else
    if shapeLabel = "circle" then
    coordinate_i = 0
    coordinate_j = 100
    next_shapelabel = "triangle"

    else
    if shapeLabel = "triangle" then
    coordinate_i = 0
    coordinate_j = 200
    next_shapelabel = "pentagon"

    else
    if shapeLabel = "pentagon" then
    coordinate_i = 100
    coordinate_j = 200
    next_shapelabel = "octagon"

    else
    if shapeLabel = "octagon" then
    coordinate_i = 200
    coordinate_j = 200
    next_shapelabel = "cross"

    else
    if shapeLabel = "cross" then
    coordinate_i = 200
    coordinate_j = 300
    next_shapelabel = "hexagon"

    else
    if shapeLabel = "hexagon" then
    coordinate_i = 200
    coordinate_j = 400
    next_shapelabel = "star"

    else
    coordinate_i = 200
    coordinate_j = 500
    end if
    end if
    end if
    end if
    end if
    endif
    end if

    SetVariable "coordinate_i",coordinate_i
    SetVariable "coordinate_j", coordinate_j
    SetVariable "next_shapelabel", next_shapelabel