Re:Simulated GPS Sensor - 2010/01/20 13:36I had a look to it and managed to get the simulated GPS service working with my code. I will upload soon a set of new services under a package called CRUBOTS (Conscious Robots Utilities for Robot Simulation), which will include a basic simulated GPS service.
First of all, in order to use the simulated GPS service with your robot, you need to insert a GPS sensor entity into your simulated robot. Therefore, you either need a simulated robot that already has a GPS sensor entity or you need to create or modify a simulated robot to add this simulated sensor (as far as I know, you can't do this using a manifest):
This code would be part of your simulated robot creation, and will add the GPS sensor entity. If you don't have this in the first place, you won't get it working.
Other thing you have to take care is the Simulated GPS service code that comes with MRDS 2008 R2. At least in the distribution I have the code has several problems. I fixed them changing the follwing code of Simulated GPS service:
Using camera entity triggered an invalid cast exception.
And, I also had to alter the state update (CheckForStateChange method):
Code:
// _state.X = _entity.State.Pose.Position.X;
_state.X = _entity.Parent.State.Pose.Position.X;
// Same for Y and Z...
Sensor entity position is relative to the parent, therefore I changed it to refer to parent's position (my robot chasis position in this case). Otherwise, you just get the position (relative to the robot) of the GPS sensor.
Hope this helps, anyway I'll let you know when I upload my code so you can see it working.Raúl Arrabales Moreno. conscious-robots.com/raul
The administrator has disabled public write access. Please, register to participate in the
forum.
Raúl
Moderator Moderator
Posts: 591
Karma: 10
Re:Simulated GPS Sensor - 2010/01/20 20:23FYI: I have already uploaded a modified version of the Simulated GPS service, which I am using in my own code.
First to all I want say you thank you very much for help. I saw your source code that you have updated and I have tried it.
I have followed your note on readme.txt but when I run it I have some problems about the manifest.
Do you think it could be possible compile a code to share and put inside the VPL framework so i can use it?
My version of Microsoft Robotics Studio it's the same of you: 2008 R2.
In alternative we can use a robot with GPS Sensor inside, so without add a service?
Then, I saw your replay here, I'm mirckley so you could read my problem.
Thank you.
The administrator has disabled public write access. Please, register to participate in the
forum.
Raúl
Moderator Moderator
Posts: 591
Karma: 10
Re:Simulated GPS Sensor - 2010/01/25 12:33Hi Mik, I've posted a preliminary version of CRUBOTS, where you can see how the simulated GPS service is used.
In order to have a service available in VPL, I think you just need to compile it. Once the corresponding dll files are in the bin directory, the service will be available in VPL.
The thing about using the Simulated GPS is that there are two components (if you want to see it that way):
- The Simulated GPS sensor entity (a visual entity). - The Simulated GPS service (associated to the former).
In order to make it work, you have to do both inserting the sensor entity to your robot, and associate it to the corresponding service. Then you can subscribe to the GPS service and get notifications.
If you look to the CRUBOTS code, the simulated robot definition code is in the MazeSimulatorRA service. The robot is created programmatically (not using a manifest):
With this code, the service will be created and running when the simulated robot is created. Then you can subscribe to the Simulated GPS service from another service (like I do from the Cranium Dashboard service).Raúl Arrabales Moreno. conscious-robots.com/raul
The administrator has disabled public write access. Please, register to participate in the
forum.
Raúl
Moderator Moderator
Posts: 591
Karma: 10
Re:Simulated GPS Sensor - 2010/03/23 21:06Version 3 of the Simulated Pioneer GPS service, which includes robot orientation (theta) is available for download at: MRDS 2008 R2 Downloads.
Yes, because every service you build in RDS will be available in VPL, so in principle you can access this service from VPL programs...
HOWEVER, since the GPS service needs to be associated with a parent entity (the simulated robot you'd like to get the position from) you need to make this arrangement in the first place (and this, I don't know if can be done directly in VPL).
So, one option is to have another service which programatically builds your robot with the inbuilt simulated GPS (as explained above) and then use the complete robot and GPS service from VPL.