logo logo
Inicio arrow Foros...
Wednesday, 07 de January de 2009
 
 
English English  Español Español  
Próximos Eventos
10.Jun. 2009

IWANN 2009
Salamanca, Spain
11.Jun. 2009

Toward a Science of Consciousness
Hong Kong, China
14.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
Etiquetas
Análisis Artificial Científicos Conciencia Consciencia Consciencia Artificial Conscientes Consciousness Developer Documentación Documentation Español Howto Investigación Publicaciones Reviews Robotics Robots Robótica Servicios Spanish Studio VPL artificial
Destacados
Conscious-Robots.com Forum  


Raúl
Moderador

Moderador
Mensajes: 444
graph
Karma: 6  
Re:How do I use the simulated sonar? - 2008/08/12 16:53 Hi, in case you want to use the simulated sonar in your own robot the first thing you need to do is to add the corresponding simulated sonar entity as a child of the robot simulated entity.
You can have a look to how this is done in the ExplorerSimSonar Application:

-> ExplorerSimSonarApplication.

In this example, the service MazeSimulatorRA creates a simulated world, including a Pioneer 3DX robot. The simulated sonar is added to the robot as follows:

Code:

         void AddPioneer3DXRobot(Vector3 position)         {             // TT Dec-2006 - Make the position a parameter             // TT Jun-2007 - Changes to the Simulated Differential Drive             // required a new version of the Pioneer3DX. This is annoying             // because it was only a change of class name but it had some             // flow-on effects. The problem arises because you can't just             // replace an entity that is in built into the Simulator.             TTPioneer3DX robotBaseEntity CreateMotorBase(ref position);             // Raul - Create the sensor entities according to settings.             if (_state.UseLRF)             {                 // Create Laser entity and start simulated laser service                 LaserRangeFinderEntity laser CreateLaserRangeFinder();                 // Add laser as child to motor base                 robotBaseEntity.InsertEntity(laser);             }             if (_state.UseSonar)             {                 // Raul - Replace LRF with SONAR:                 SonarEntity sonar1 CreateSonar(0.0f);                 // Raul - Insert Sonar                 robotBaseEntity.InsertEntity(sonar1);             }                                      // Create bumper array entity and start simulated bumper service             BumperArrayEntity bumperArray CreateBumperArray();             // Insert as child of motor base             robotBaseEntity.InsertEntity(bumperArray);             // TT - Copied from Oct CTP Simulation Tutorial 2             // Create Camera Entity and start SimulatedWebcam service             CameraEntity camera CreateCamera();             // insert as child of motor base             robotBaseEntity.InsertEntity(camera);             // Reverse the orientation of the robot so that it will             // drive "forwards" from the user's perspective (it is             // actually driving in the Z direction)             robotBaseEntity.State.Pose.Orientation Quaternion.FromAxisAngle(010, (float)(Math.PI));             // Finaly insert the motor base and its two children              // to the simulation             //_simEnginePort.Insert(robotBaseEntity);             SimulationEngine.GlobalInstancePort.Insert(robotBaseEntity);         }



Note that I use a flag to insert either a laser or a sonar depending on my current configuration...

And the createSonar method is as follows:

Code:

         /// <summary>         /// Creates a frontal SONAR array entity for the Pioneer 3 DX robot.          /// </summary>         /// <param name="dx">X position of sonar source "rays"</param>         /// <returns></returns>         private SonarEntity CreateSonar(float dx)         {             // Create a Sonar Entity.             // Place it 30cm above base CenterofMass.              SonarEntity sonar = new SonarEntity( new Pose(new Vector3(dx0.30f0)) );             sonar.State.Name "SimulatedSonar";             // TT - From Oct CTP             sonar.SonarBox.BoxState.DiffuseColor = new Vector4(0.25f0.25f0.8f1.0f);             // Create Sonar simulation service and specify             // which entity it talks to             CreateService(                 pxsonar.Contract.Identifier,                 Microsoft.Robotics.Simulation.Partners.CreateEntityPartner(                 "http://localhost/" sonar.State.Name));             return sonar;         }



Hope this helps...
Cheers,
Raúl.
Raúl Arrabales Moreno. conscious-robots.com/raul
  El administrador ha deshabilitado la escritura de mensajes a los usuarios no registrados.

      Temas Autor Fecha
    emo
How do I use the simulated sonar?
Raúl 2008/08/12 16:43
    emo
thread linkthread link Re:How do I use the simulated sonar?
Raúl 2008/08/12 16:53
    thread link
thread linkthread linkthread link Re:How do I use the simulated sonar?
carlcs 2008/08/23 08:50
    emo
thread linkthread linkthread linkthread link Re:How do I use the simulated sonar?
Raúl 2008/08/25 09:53
Titulares RSS
 Conscious Robots RSS FeedFuente RSS de Conscious Robots





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