locked
two actions RRS feed

  • Question



  • hi,,,can any one tell me how to do this :

    I am using VPL......i want to make the robot move forward an specific distance (ex: 4 meters) then turn left or right
    some degrees...

    i've tried to do like this :

    Data ------->"DriveDistance"(GenericDrive) --------> "rotateDegree"(GenericDrive)

    but in this case the robot just move forward then stop and do not rotate !!!!!
    how can i solve this problem ??

    why after he moves that distance he stop ??



    thank you very much

    Thursday, August 28, 2008 7:49 PM

Answers

  • You have quite a few questions :-)

     

    The LEGO simulation currently does not have a Sonar sensor, so avoiding obstables is difficult.

     

    However, if you don't care which robot you use (it is a simulation anyway) then you can use the Pioneer 3DX with its Laser Range Finder.

     

    Finding a blue ball can be done using the Color Segment service. Have a look in samples\Technologies\Vision. I would not try to do this in VPL. However, with the Color Segment service you do not have to write the code yourself.

     

    If your feedback loop is fast enough, you do not have to use DriveDistance and instead you can simply use SetDrivePower. When you see an obstacle, change the wheel speeds accordingly to veer or turn to the left/right. However, if you want to measure the distance travelled and build some sort of map, then this approach will not work.

     

    Think about how you want to proceed.

     

    Trevor

     

    Monday, September 1, 2008 8:31 PM

All replies

  • You have hit upon a complicated issue in the generic drive contract.

     

    Some implementations of DriveDistance and RotateDegrees, such as in the simulation and the iRobot Create, wait until the motion is complete before sending a response. So you can do exactly as you have shown in your diagram.

     

    However, other implementations don't work this way and immediately send a response. This causes VPL to move straight to the next activity without waiting for the first one to complete. In some cases the second request will cancel the first one and so you only see one action.

     

    I cannot suggest a workaround at this stage because it depends on which particular drive service you are using.

     

    We have recognized that this is a problem and it will be addressed in V2.0.

     

    Trevor

     

    Thursday, August 28, 2008 11:11 PM

  • thank u Trevor.. OK,, is there any idea how to do that using C# ??
    I'm not very good in programming but i can try if you help me with some steps..

    i just want the robot to avoid an obstacle (using Leaser or infrared ) and try to find a blue ball placed behind that obstacle (using camera)..all using Simulation.
    is that difficult to do ??

    ( ex:   the robot move forward ----> if there is an obstacle -----> turn left or right -----> look if the ball is there
    -----> if not move 3 meters and look again ------> if no ball turn left or right then look again----->if no ball move again 3 meters and so on.. )

    something like that..


    As i told you that i used VPL but it does not work because of the problem i explained it in my previous msg..i have generated that VPL to C# code,so can i modify this code to do these things or should i start coding from zero??

    thanx very much in advance.

    Sunday, August 31, 2008 1:36 PM
  • You have quite a few questions :-)

     

    The LEGO simulation currently does not have a Sonar sensor, so avoiding obstables is difficult.

     

    However, if you don't care which robot you use (it is a simulation anyway) then you can use the Pioneer 3DX with its Laser Range Finder.

     

    Finding a blue ball can be done using the Color Segment service. Have a look in samples\Technologies\Vision. I would not try to do this in VPL. However, with the Color Segment service you do not have to write the code yourself.

     

    If your feedback loop is fast enough, you do not have to use DriveDistance and instead you can simply use SetDrivePower. When you see an obstacle, change the wheel speeds accordingly to veer or turn to the left/right. However, if you want to measure the distance travelled and build some sort of map, then this approach will not work.

     

    Think about how you want to proceed.

     

    Trevor

     

    Monday, September 1, 2008 8:31 PM