i managed to find a sonar and 2d pose and orientation log file of a pioneer robot that was making a map of the 1st floor of the CSIS building in the University of Limerick, Ireland.
what i'm attempting to do is make a service that reads in the log and breaks each line into the 2dpose and orientation array and the sonar range data array and then signal another service that is listening for sonar updates and, since I'm still working on it, pose updates.
how will i do this, especially the signaling part because I'm getting confused. hahaha
The administrator has disabled public write access. Please, register to participate in the
forum.
Raúl
Moderator Moderator
Posts: 434
Karma: 6
Re:how do i "pass" data to other services? - 2008/10/08 17:53Hi carlcs, hey I know that building.. I used to work close to there (in the Foundation building) like six years ago!
For the signaling part, I would use the standard MSRS service subscription model. Also, I would write two separate services: one serving sonar reading and other serving pose paramenters (although both of them take the date from the same log file). The reason is that probably you want your control code, let's call it control service, to be written just once independently of whether you read data from a real sonar or from the logged-sonar reader service.
So you could write a, say LoggedSonar service, which will implement the generic contract for Sonar. Thus, your control code doesn't need to know about special cases, like using a real sonar, or a simulated one, or in your case a logged sonar reader. You can have a look to my simulated sonar service to check how the generic sonar contract can be implemented, and also you can check how state updates are notified to subscribers. You could implement a timer (like in MSRS service tutorials incrementTick) and send a new sonar reading everytime the timer tick handler is executed. Does this makes sense for you? Is this what you want to do?
The administrator has disabled public write access. Please, register to participate in the
forum.
carlcs
User Expert Boarder
Posts: 20
Karma: 1
Re:how do i "pass" data to other services? - 2008/10/09 14:45yeah!!! that's exactly what i want to do. the mapping service i want to run using the real-world data already runs in simulation. yeah. that's what I'm trying to make. i don't want to change the mapping service so it will be generic.
one other problem is that the mapping service uses the simulated differential drive to estimate pose and orientation. but since there is already pose and orientation data, do i have to make some sort of "special" listener for it?
The administrator has disabled public write access. Please, register to participate in the
forum.
Raúl
Moderator Moderator
Posts: 434
Karma: 6
Re:how do i "pass" data to other services? - 2008/10/09 20:48Yes, your control service will have to subscribe to a pose estimation service in order to retrieve localization data. Actually, the way you are corrently getting the pose is a trick that can only be done in the simulator, and doesn't scale to the real world (I am doing the same trick by the way ).
Normally, in a real world environment you would apply any SLAM algorithm (Simultaneous Localization and Mapping) taking as input data from the wheel encoders. However, in your case you will replace the SLAM algorithm by a source of already calculated data, which is your log file. Again, this way of organizing the services allow you to write a generic control service independently of the source of your localization data: it could be either the localization log reader or a real pose estimation service. You could even define a new generic service for a SLAM service following an analogous strategy as you followed with the Sonar stuff...Raúl Arrabales Moreno. conscious-robots.com/raul
The administrator has disabled public write access. Please, register to participate in the
forum.
carlcs
User Expert Boarder
Posts: 20
Karma: 1
Re:how do i "pass" data to other services? - 2008/10/10 05:12hello again. i was reading your simulated sonar service and i got lost. so, if i were to make something similar to this, i;m guessing i don't need the SonarEntity class. But when i remove it, there are a lot of things dependent on it. Also, i noticed that most of the code involves listening to lrf updates so i'm guessing i don't need that too. i still couldn't find the part where it generates a sonar reading update so that other services will get its data. may i ask what part it is in?
The administrator has disabled public write access. Please, register to participate in the
forum.
Raúl
Moderator Moderator
Posts: 434
Karma: 6
Re:how do i "pass" data to other services? - 2008/10/10 18:17Hi, 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:
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
The administrator has disabled public write access. Please, register to participate in the
forum.