locked
How can I use Corobot's sensors via C# code and make the robot avoid obstacles in a simulation? RRS feed

  • Question

  • Hello!

    It's been quite a while since I've been using VPL and have a general idea on visual programming. However, I now want to use the "Chapter 6" code of the "promrds" book where there is a Corobot in a simulation environment with a box in front of it.

    I want the Corobot to move autonomously and change it's path when it finds the box in it's IR sensor's range, all in C#. How can I go about doing this? Can i find any code that would help?

    Any help would be appreciated.

    Best regards,

    Ali.

    P.S. I am not new to C#.

    Tuesday, May 18, 2010 12:09 PM

Answers

  • Please look in Chapter 11 at the 6-backandforth example in VPL. This shows you how to do what you want.

    Then you can either create a new DSS service specifying the appropriate partnerships and work it out for yourself, or you can use the "Compile as a Service" option in VPL to create some C# code and look at that.

    If you are using RDS 2008 or RDS 2008 R2 Express Edition, you can't use the "Compile as a Service" option. However, if you upgrade to RDS 2008 R3 this option is available.

    Trevor

     

    Saturday, May 22, 2010 6:41 AM

All replies

  • Please look in Chapter 11 at the 6-backandforth example in VPL. This shows you how to do what you want.

    Then you can either create a new DSS service specifying the appropriate partnerships and work it out for yourself, or you can use the "Compile as a Service" option in VPL to create some C# code and look at that.

    If you are using RDS 2008 or RDS 2008 R2 Express Edition, you can't use the "Compile as a Service" option. However, if you upgrade to RDS 2008 R3 this option is available.

    Trevor

     

    Saturday, May 22, 2010 6:41 AM
  • Thank you for your advice. I've done what you said and hopefully would try to figure out.

    Best regards.

    Saturday, May 22, 2010 7:19 AM
  • Dear Trevor:

    Your response was of help. I used the "Compile as a service" option which created the C# codeHowever, to use it, I need to understand what has been done and where. I can't seem to figure out how the code flows.

    I am more interested in the part which makes the robot move by itself while using the IR sensors readings to avoid obstacles.

    Could you possible give me a direction as to which part of the code it is? Or, maybe somewhere I can learn it from?

    Best regards,

    Ali

    Monday, May 24, 2010 1:25 PM
  • A good rule of thumb I use when teaching individuals CCR/DSS is to read through the book www.promrds.com Chapter 1-4.  Until you understand CCR/DSS, you will have a hard time understanding the Chapter 6 "Compile as a service" code.

    Once you have a firm understanding of what CCR/DSS is and how to use it, then do please take a look at Chapter 6 in the book.  It has a very nice walkthrough regarding which methods are for driving and which are for obstacle avoidance, etc.

    Wednesday, May 26, 2010 12:06 AM
    Moderator