locked
hello World - Microsoft Robotic Studio RRS feed

  • Question

  •  

    I have my based microcontroler robot that commnicate with PC via rs232 using a simple ascii protocol like

    that send string with commands and wait the return value.

    I develop classes in C# that do the job with System.IO.Ports

    I need a help on create a service and utilize with VPL.

    The documentation is confusing and out of date ( VS2005)

    I don´t want buy any book.

    Documentation and tutorials are based in simulation and don´t touch the point with real hardware.

    Reading the forum there is many threads with the same query.

    Please Microsoft help us roboticists with MRS !!!!!!!!!!!

    Thank you

     

     

    Tuesday, September 23, 2008 4:44 PM

Answers

  • Since you already have an ASCII protocol for communicating with your robot and I assume that all works OK, you just need to write a service in C# to talk to the robot.

     

    Many of the sample services provided with RDS use serial communications. Alternatively, you can download the book samples from http://promrds.com and have a look at the Hemisson robot in Chapter 17 for example.

     

    Once you have a working service in C#, it will appear in the Services panel of VPL. There is really no way to write basic services like this directly in VPL. This should not be a problem as you have already created code in C#.

     

    Trevor

    Tuesday, September 23, 2008 5:16 PM

All replies

  • Since you already have an ASCII protocol for communicating with your robot and I assume that all works OK, you just need to write a service in C# to talk to the robot.

     

    Many of the sample services provided with RDS use serial communications. Alternatively, you can download the book samples from http://promrds.com and have a look at the Hemisson robot in Chapter 17 for example.

     

    Once you have a working service in C#, it will appear in the Services panel of VPL. There is really no way to write basic services like this directly in VPL. This should not be a problem as you have already created code in C#.

     

    Trevor

    Tuesday, September 23, 2008 5:16 PM
  • Thanks Trevor

     

    I studied the example with Hemisson Robot and can learning something.

    By now i create my service:

    dssnewservice /namespace:Robotics /service:myservice_1

     

    and build them:

    cd myservice_1

    msbuild myservice_1.sln

     

    Now i can see this service in VPL.

    But now i need know how can i insert the code for my robot.

     

    I have classes write em C# that work with my robot like this:

     

    // this send data to control a servomotor on board

    private void servo(byte what_servo, byte position)

    {

    byte[] data_to_send= new byte[20];

    data_to_send[0] = (byte)':';

    data_to_send[1] = (byte)'s';

    data_to_send[2] = (byte)(48 + what_servo);

    data_to_send[3] = position;

    data_to_send[4] = 13;

    data_to_send[5] = 10;

    int f = 0;

    for (f = 0; f <= 5; f++)

    {

    port.Write(data_to_send, f, 1);

    System.Threading.Thread.Sleep(20);

     

    }

    }


     

    The board in robot process the command and return a acknoledge message that is captured by serial event:

    private void port_DataReceived(object sender, SerialDataReceivedEventArgs e)

    {

    ... my code

    }

     

    How this classes can work with my service?

    Thank you

     

    Wednesday, September 24, 2008 11:05 AM
  • If you look in the Hemmison code you should be able to find where it sends data to the robot.

     

    Another of the samples to look at is the Lynxmotion arm in Chapter 15 of the book. The SSC32 service (the original code was provided by Lynxmotion) controls up to 32 servo motors using a serial connection. It might be even closer to what you need.

     

    You will have to define at least one operation in your service for setting the servo position. An empty service created with DssNewService has only the very basic operations. In the SSC32 service you will see an operation called SendSSC32Command in SSC32Types.cs. You might want to simplify it because it uses a lot of different command message types. You could add a SetServo operation for example, with a request type that contains the servo number and the position.

     

    Just be careful about using Thread.Sleep in your code. Remember, RDS is multi-threaded and you will be blocking a thread.

     

    Trevor

     

    Wednesday, September 24, 2008 4:44 PM
  •  

    I work with embedded system and in pc side C# is my tool. But i´m not a expert in SOAP e Webservice, the technology that surround Microsoft Robotic Studio.

    Besides help in this forum  it´s dificult develop the software in Microsoft Robotic Studio to work with my hardware board.

    I think that somebody could send something like a Template could do easy develop the applications and help other users.

    Maybe  my dificult could be common to other users.  

    Thank´s for any help.

     

    Trevor  i could not modify SSC32 service to work properly with my hardware.

     

    Thursday, September 25, 2008 6:16 PM
  • I will look at providing an example. However, this is difficult to generalize because every different robot has a different protocol.

     

    You do not need to use SOAP or Web services to use RDS. I think you might have some misconceptions there. The communications between services are similar to Web services, but you don't have to program at this level - DssHost takes care of the communications.

     

    Trevor

     

    Friday, September 26, 2008 6:20 AM
  • Again Thank you Trevor

    I wil wait your example.

     

    Marco

     

    Friday, September 26, 2008 5:01 PM