logo logo
Home arrow Forums...
Monday, 21 May 2012
 
 
 
Conscious-Robots.com Forum  


Raúl
Moderator

Moderator
Posts: 591
graph
Karma: 10  
Re:Maze solver - 2010/02/10 14:39 In the case of the Maze Simulator, the simulated robot is created programatically, and so are created the associated simulated sensors as well. This means that there is no need to specify these services in the manifest: when you create the MazeSimulator service, the robot-related services are created as a consequence.

Note there is a method called AddPioneer3DXRobot in the MazeSimulatorRA service. This code creates the simulated sensors. For instance, the Laser Range Finder (LRF) is created using a call to CreateLaserRangeFinder:

Code:

 private LaserRangeFinderEntity CreateLaserRangeFinder() {    // Create a Laser Range Finder Entity.    // Place it 30cm above base CenterofMass.     LaserRangeFinderEntity laser = new LaserRangeFinderEntity(       new Pose(new Vector3(00.30f0)));    laser.State.Name "SimulatedLRF";    laser.LaserBox.State.DiffuseColor =           new Vector4(0.25f0.25f0.8f1.0f);    // Create LaserRangeFinder simulation service and specify    // which entity it talks to    CreateService(        lrf.Contract.Identifier,        Microsoft.Robotics.Simulation.Partners.CreateEntityPartner(          "http://localhost/" laser.State.Name)    );    return laser; }



In short, as you are using this code, the service is created programatically, and therefore you don't need to add the sensor services to the manifest.

Now, you probably want to subscribe to these sensor services from another service, say a Control Service.

This Control Service has to establish a partnership with the sensor services. The way I do this is as follows:

For instance, for the bumper sensor, in your Control Service you will specify a partnership with the generic bumper contract:

Code:

 [Partner("Bumper",           Contract bumper.Contract.Identifier,           CreationPolicy PartnerCreationPolicy.UseExisting)] bumper.ContactSensorArrayOperations _bumperPort =      new bumper.ContactSensorArrayOperations(); bumper.ContactSensorArrayOperations _bumperNotify =      new bumper.ContactSensorArrayOperations();



Note here that I use "UseExisting" as Creation Policy, given the specific simulated bumper service already exists (it was created during MazeSimulationRA service startup).

For other services that you specify in the manifest, you wouls use the option UsePartnerListEntry.

Hope this helps..
Raúl Arrabales Moreno. conscious-robots.com/raul
  The administrator has disabled public write access. Please, register to participate in the forum.

      Topics Author Date
    emo
Maze solver
Kalos 2010/02/02 00:18
    emo
thread linkthread link Re:Maze solver
Raúl 2010/02/04 12:09
    thread link
thread linkthread linkthread link Re:Maze solver
Kalos 2010/02/09 03:50
    emo
thread linkthread linkthread linkthread link Re:Maze solver
Raúl 2010/02/10 14:39





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

 
Last Posts in Forum
 
CR
miel continental