Maze Simulator
Because this is a new discussion forum, and there are a lot more people participating now, I am re-posting a link to my Maze Simulator. Sure it's unashamed self-promotion, but I'm an academic and that is one of the job requirements
The Maze Simulator allows you to easily build an environment with various types of walls simply by editing a bitmap image file. Then you can use the simulated Pioneer robot to wander about. You can download the code from here:
http://sky.fit.qut.edu.au/~taylort2/MRS/
I must acknowledge that the original idea and source code came from TheRoboticBen. Thanks for that Ben!
Trevor
glad to hear from you again Trevor! Check out our new On-Demand video tutorials, they should help the documentation gap. Also check out our new simulated soccer, and soon to be released simulated Sumo packages...
Hello Trevor,
I am trying to use the Maze simulator but I am getting the following error:
### DsspForwarder:InboundFailureHandler. Exception
ource array type cannot be assigned to destination array type. Action:http://schemas.microsoft.com/xw/2004/10/dssp.html:GetResponse Body Type:Robotics.MazeSimulator.Proxy.MazeSimulatorState Target Service
ssp.tcp://rrc-laptop:50001/mazesimulator Source Service:
Do you have an idea on how to resolve this?
Thanks.
Renato
Sorry, I have not seen this error before. What version of MSRS are you using? The code on my web site was built with version 1.0, although I have tried it using the April CTP of 1.5 and it still works.
However, the error suggests to me that you might need to recompile everything. Please do a Rebuild on the Maze Simulator.
I have just downloaded my code to a different PC and run it successfully with version 1.0, although I had to remove the reference to the Simulated DifferentialDrive and re-add it. I don't know why this happens because the properties say it does not require a specific version. Maybe Microsoft can comment on versioning of the DLLs.
Trevor
Ah, now I see the problem. In the May 1.5 CTP it gets an error when it tries to load the saved state. I assume that this is the error you are talking about.
System.ArrayTypeMismatchException was unhandled by user code
Message="Source array type cannot be assigned to destination array type."
Source="mscorlib"
StackTrace:
at System.Array.Copy(Array sourceArray, Int32 sourceIndex, Array destinationArray, Int32 destinationIndex, Int32 length, Boolean reliable)
at System.Array.CopyTo(Array array, Int32 index)
at Dss.Transforms.TransformMazeSimulator.Transforms.Transform_Robotics_MazeSimulator_Proxy_MazeSimulatorState_Robotics_MazeSimulator_MazeSimulatorState(Object transformObj) in c:\Microsoft Robotics Studio 1.5 (CTP May 2007)\samples\MazeSimulator\Proxy\mazesimulator.source.transform.cs:line 41
at Microsoft.Dss.Services.Serializer.DataCache.TransformToService(Object proxyClass)
at Microsoft.Dss.Services.Forwarders.Dssp.DsspForwarder.FindRequest(ForwarderEnvelope msg)
at Microsoft.Dss.Services.Forwarders.Dssp.DsspForwarder.InboundHandler(ForwarderEnvelope msg)
Unfortunately, this error occurs inside some code that is automatically generated by MSRS when you compile! So I don't know how to fix it. Can anyone from Microsoft shed some light on this?
The particular section of code is:
// copy System.Single[] target.HeightMap = from.HeightMap
if (from.HeightMap != null) {
target.HeightMap =
new System.Single[from.HeightMap.GetLength(0)]; from.HeightMap.CopyTo(target.HeightMap, 0);
}
where HeightMap is an array of 16 floats that are read from the saved state XML file. The error indicates that the problem occurs on the 'if' statement, which does not make much sense because it is not trying to do a copy. So this leads me to suspect that the line number is incorrect and the debugger is pointing to the wrong place.
Trevor
Found the problem. I am using a Vector3 array to hold the colours for the maze walls. However, in the code that is generated by MSRS it is creating the 'from' object with Microsoft.Robotics.PhysicalModel.Proxy.Vector3[], but the 'target' object is created WITHOUT the .Proxy. I don't understand why these two should be different, but obviously the CopyTo method thinks that they are.
So, over to Microsoft to sort this one out. I consider it to be a bug in MSRS since I did not generate this code which is in the Transform file:
// copy Microsoft.Robotics.PhysicalModel.Vector3[] target.WallColors = from.WallColors if (from.WallColors != null) {
target.WallColors =
new Microsoft.Robotics.PhysicalModel.Vector3[from.WallColors.GetLength(0)]; from.WallColors.CopyTo(target.WallColors, 0);
}
You got the exact point. Unfortunately, as there is no solution (at least for now), it doesn't run on the May CTP 1.5.
Thanks!
Renato
ok we are looking into this, thanx for the report. Its clearly not by design, so it will be fixed for 1.5 final
Thanks George. I also have a post on this problem in the main community forum. Interestingly, there is another post immediately after mine that seems to be related to the same problem.
Do you have any idea how many more CTPs there will be before V1.5 ships?
Trevor
We currently dont anticipate anymore CTPs before 1.5 ships, but that is subject to change.
We will ofcourse verify this regression is fixed.