logo logo
Inicio arrow Foros...
Tuesday, 02 de December de 2008
 
 
English English  Español Español  
Próximos Eventos
10.Jun. 2009

IWANN 2009
Salamanca, Spain
International Work-Conference on Artificial Neural Networks
11.Jun. 2009

Toward a Science of Consciousness
Hong Kong, China
15.Jun. 2009

International Workshop on Machine Consciousness
Hong Kong, China
15.Jun. 2009

The 8th IEEE International Conference on Cognitive Informatics
Hong Kong, China
22.Jun. 2009

IWINAC 2009
Santiago de Compostela, Spain
Work-Conference in the Interplay between Natural and Artificial Computation
Etiquetas
Análisis Artificial Associations Científicos Conciencia Consciencia Consciencia Artificial Conscientes Consciousness Developer Documentación Documentation Español Investigación Publicaciones Reviews Robotics Robots Robótica Servicios Spanish Studio VPL artificial
Destacados
Titulares RSS
 Conscious Robots RSS FeedFuente RSS de Conscious Robots
Conscious-Robots.com Forum  


carlcs
Usuarios

Expert Boarder
Mensajes: 20
graphgraph
Karma: 1  
simulated sonar, states and operations - 2008/08/27 17:21 i was reading the code for the lrf and the simulated sonar here and i was wondering where the simulated sonar stored it's state variables and operations.

the lrf has a SickLRFState.cs file if i remembered right and it has a class called SickLRFOperations.

does the simulated sonar have those kind of state files and operation classes?
  El administrador ha deshabilitado la escritura de mensajes a los usuarios no registrados.
Raúl
Moderador

Moderador
Mensajes: 432
graph
Karma: 6  
Re:simulated sonar, states and operations - 2008/08/28 09:44 Yes, you are right, the Sonar service has analogous structure. Indeed, what I do is to implement the generic contract for sonar provided by MSRS. Therefore, I don't really need to define new classes for state and operations, they are already there as part of the generic contract definition. What I do is to reference to the RoboticsCommon assembly, where the generic contract is defined and then use these types:

Code:

 // Raul - SONAR Generic Contract using pxsonar Microsoft.Robotics.Services.Sonar.Proxy;



As I am implementing the generic contract, I have an alternate contract identifier:

Code:

 [AlternateContract(pxsonar.Contract.Identifier)]



This is the state definition taken from the generic contract:

Code:

 private pxsonar.SonarState _state null;



And I also use the sonar operations definition from the generic contract:

Code:

 [ServicePort("/SimulatedSonar"AllowMultipleInstances true)] private pxsonar.SonarOperations _mainPort = new pxsonar.SonarOperations();



By the way, I've seen in my code that I added a comment saying that the service models just one single transducer. That is wrong!! That was my older idea, but I ended up modeling the Pioneer frontal sonar ring with 8 transducers! And therefore, I allocate 8 positions in the array of doubles that represents sonar measurements in the Sonar service state:

Code:

 /// <summary> /// Number of SONAR devices in the simulated SONAR Ring. /// </summary> public const int SonarArrayLength 8;

Raúl Arrabales Moreno. conscious-robots.com/raul
  El administrador ha deshabilitado la escritura de mensajes a los usuarios no registrados.
carlcs
Usuarios

Expert Boarder
Mensajes: 20
graphgraph
Karma: 1  
Re:simulated sonar, states and operations - 2008/08/28 12:22 oh i see... so, if for example i need to use the SonarOperations class with the simulated sonar, i will have something like

SonarEntity sonar= new SonarEntity();

sonar.SonarOperations _mainport= new sonar.SonarOperations();

and for it's state something like

private sonar.SonarState _state = null;

am i correct?
  El administrador ha deshabilitado la escritura de mensajes a los usuarios no registrados.
carlcs
Usuarios

Expert Boarder
Mensajes: 20
graphgraph
Karma: 1  
Re:simulated sonar, states and operations - 2008/08/28 13:29 or something like...

using sonar= Cranium.Simulation.Sensors.Proxy;
sonar.SonarOperations _mainport= new sonar.SonarOperations();

and for it's state something like

private sonar.SonarState _state = null;

something like that?
  El administrador ha deshabilitado la escritura de mensajes a los usuarios no registrados.
Raúl
Moderador

Moderador
Mensajes: 432
graph
Karma: 6  
Re:simulated sonar, states and operations - 2008/08/28 15:08 Well, what you probably want is to subscribe to the sonar service and get notifications when its states changes, i.e. get the new sonar readings when they robot has moved (or something moved in front of the sonar).

In order to do that, you should use the generic contract for sonar and declare a parter of your service, something like this:

Code:

 // Raul - Sonar generic contract using pxsonar Microsoft.Robotics.Services.Sonar.Proxy; ... [Partner("Sonar"Contract pxsonar.Contract.IdentifierCreationPolicy PartnerCreationPolicy.UseExisting)] pxsonar.SonarOperations _sonarPort =                   new pxsonar.SonarOperations(); pxsonar.SonarOperations _sonarNotify =                   new pxsonar.SonarOperations(); ... // Within your start() method, maybe within an Interleave: Arbiter.ReceiveWithIterator<pxsonar.Replace>(true_sonarNotifyOnSonarReplaceHandler),



Have a look to the service tutorials if you have doubts about how the subscription works. Then, you could find useful to have a look to my code in ExplorerSimSonar that uses the Simulated Sonar.

Remember that you _mainport is for your own service opeations. For sonar notifications you declare another port as shown above.

Post edited by: Raúl, at: 2008/08/28 15:09
Raúl Arrabales Moreno. conscious-robots.com/raul
  El administrador ha deshabilitado la escritura de mensajes a los usuarios no registrados.
carlcs
Usuarios

Expert Boarder
Mensajes: 20
graphgraph
Karma: 1  
Re:simulated sonar, states and operations - 2008/08/28 16:40 cool! thanks. i'll try that. i'm sorry if i'm a little persistent. hahaha
  El administrador ha deshabilitado la escritura de mensajes a los usuarios no registrados.





¿Recuperar contraseña?
¿Quieres registrarte? Hazlo aquí
Mensajes en el Foro
 
Top! Top!