Raúl
Moderador
 Moderador
| Mensajes: 444 |  | Karma: 6
|
Re:how do i "pass" data to other services? - 2008/10/10 18:17
Hi, you don't need the SonarEntity class because it is what represent the simulation entity in the MSRS simulation environment. In your case, instead of interfacing with the simulation you interface with a log file, so there is no need of simulation entities.
LRF updates as you say are the raytracing done in the simulator in order to calculate sonar readings. Again, as you just read from a log, you don't need to calculate anythig, just read the sonar measurements from the file.
If you look into the SimulatedSonar.cs file, the following method is the one issuing the notification to the subscribers of the service:
| Code: | [ServiceHandler(ServiceHandlerBehavior.Exclusive)]
public IEnumerator<ITask> ReplaceHandler(pxsonar.Replace replace)
{
_state = replace.Body;
if (replace.ResponsePort != null)
replace.ResponsePort.Post(dssp.DefaultReplaceResponseType.Instance);
// issue notification
_subMgrPort.Post(new submgr.Submit(_state, dssp.DsspActions.ReplaceRequest));
yield break;
}
|
Take a look to the MSRS service tutorials about subscription to understand how this works. Basically this services accepts subscriptions, and sends its updated state (in this case the sonar readings) using the Subscription Manager port.
The ReplaceHandler method is called because I post a replace message to myself when I have a new sonar reading...
Raúl Arrabales Moreno. conscious-robots.com/raul |