logo logo
Home arrow Robotics Studio... arrow Robotics Developer Studio Resources and Howto arrow More than 20 ports in a PortSet
Tuesday, 22 May 2012
 
 
Main Menu
Home
Conscious Machines...
AI Techniques...
Neuroscience...
Researchers...
Publications...
Reviews...
MC Bibliography
Robotics Studio...
Forums...
Blog...
Frontpage
Upcoming Events
05.Jun. 2012

Cognition & Consciousness
Menorca. Spain
02.Jul. 2012

ASSC 16
Brighton, UK
02.Jul. 2012

Revisiting Turing and his Test
Birmingham, UK
31.Oct. 2012

BICA 2012
Palermo. Italy
Tag Cloud
Associations Books Conferences Conscious Conscious Machines Consciousness Developer Documentación Documentation Español Machine Machine Consciousness Machines Neuroscience Publications Research Researchers Reviews Robotics Robots Spanish Studio VPL Work
Spotlight
More
Reader's Preferred
MCexperts List
FAQs
Glossary
Site Map
More than 20 ports in a PortSet Print E-mail
Written by Raúl Arrabales Moreno   
Monday, 03 September 2007

How to use more than twenty ports in a PortSet?

In Robotics Studio the operations supported by a service are also defined as ports in a CCR PortSet (Microsoft.Ccr.Core.PortSet).  And the former is defined as a set of generic ports: PortSet<T0, ..., T19>.

The problem comes when you want to use more than 20 ports in the same port set, because there is no definition for PortSet<T0,...,T24> for instance.

The good news (as answered by George Chrysanthakopoulos in MSRS forum) is that there is a new variable type PortSet available in MSRS 1.5. Using it you can have as many operations as you want.

Note: In .NET Compact Framework the limitation is 8 generic type arguments for any class. However, this same approach can be applied to work arround this issue.

Follow these steps to use as many ports as you want:

1.- Instead of using the generic PortSet, use the non-generic PortSet class and pass the types of operations as a list in the constructor of PortSet:

Example:

Instead of using:

class DriveControlEvents : PortSet<OnLoad,OnClosed,...> 

Use the following:

public class DriveControlEvents : PortSet
{
public DriveControlEvents()

    : base(
typeof(OnLoad),
typeof(OnClosed),
typeof(OnChangeJoystick),
typeof(OnConnect),
typeof(OnConnectMotor),
typeof(OnConnectSonar),
typeof(OnConnectSickLRF),
typeof(OnConnectArticulatedArm),
typeof(OnConnectWebCam),
typeof(OnStartService),
typeof(OnMove),
typeof(OnRotate),
typeof(OnTranslate),
typeof(OnEStop),
typeof(OnApplyJointParameters),
typeof(OnDisconnectSonar),
typeof(OnDisconnectSickLRF),
typeof(OnDisconnectWebCam),
typeof(OnLogSetting),
typeof(OnQueryFrame),
typeof(OnConnectSetting),
typeof(OnOptionSettings))
{}
}

 

2.- If your services posts to itself, replace the post messages with PostUnknownType method.

Example:

private void btnConnectSonar_Click(object sender, EventArgs e)
{
  
string SONAR = ServiceByContract(pxsonar.Contract.Identifier);
  
if (sonar != null)
   {
       _eventsPort.PostUnknownType(
new OnConnectSonar(this, sonar));
   }
}

 

3.- In the main Arbiter pattern (for instance, the Interleave where you specify the handlers for operations), replace Arbiter.Receive with ArbiterReceiveFromPortSet and Arbiter.ReceiveWithIterator with Arbiter.ReceiveWithIteratorFromPortSet for those operations defined for the non-generic PortSet.


Add as favourites (215) | Quote this article on your site | Views: 5194

  Be first to comment this article
RSS comments

Only registered users can write comments.
Please login or register.


Related Items:

  1. Raúl Arrabales Moreno
  2. Lectures on Machine Consciousness - Madrid 2011
  3. Jobs: Two Chair positions for new Centre for Computational Neuroscience and Co
  4. Birmingham Fellows in Robotics and Cognitive Systems
  5. Finding papers about consciousness and robotics
  6. Paladyn. Journal of Behavioral Robotics
  7. International Journal of Social Robotics
  8. Retecog 2011 - The Architectures of Mind
  9. Toward a Science of Consciousness - Stockholm - Live Streaming
  10. Consciousness and AI. AAAI Symposium. 2007
Last Updated ( Monday, 03 September 2007 )
 





Lost Password?
No account yet? Register
 Conscious Robots RSS FeedConscious Robots RSS Feed

Find us on Facebook

Follow us on TwitterFollow us on twitter
Spotlight

Machine Consciousness Bibliography Database

 

ConsScale
The Cognitive Machine Consciousness Scale

 
Categories
Last Posts in Forum
 
CR
miel continental