MSRS Code Page Home      Differential Drive

Simulated Differential Drive

NOTE: THIS SERVICE IS REQUIRED TO RUN THE MAZE SIMULATOR, WHICH IS REQUIRED FOR THE INTRO AND EXPLORER SERVICES.

The Simulated Differential Drive is a key component of simulated robots. In version 1.0 of MSRS it did not support two key functions that were required for the Explorer service: RotateDegrees and DriveDistance. I decided to implement these during the development of version 1.5 based on a Community Technology Preview.

With the release of version 1.5, Microsoft has provided these functions. However, the implementations have some minor bugs (which I have reported), so I continue to use my own version.

The other reason for using my own version is that it obtains the pose from the simulation entites so that mapping can be performed. This is clearly cheating because a real robot cannot simply read its coordinates and orientation from some magic sensor. However, for the purposes of learning about how to draw maps this is useful.

The code picks up the pose information from the simulated differential drive entity. It then places this info into the Left and Right Wheel pose fields. (Currently, these pose fields for the wheels are not updated by the Microsoft software.) I would have preferred to put it into the pose of the Differential Drive itself, but there is no such field defined in the generic differential drive and I did not want to create an alternate contract just for this one field.

Note that the same pose is copied to BOTH of the wheels, which is not correct. The actual pose for each wheel should be offset by half of the wheelbase, but since the objective is simply to find the location of the differential drive itself, I do not bother to calculate the correct wheel locations.

Legal Stuff

This code is a hack to the Microsoft Simulated Differential Drive. I don't claim any rights to the code. There could be bugs in my code because I might not have fully understood how the Microsoft code works.

[ MSRS Code Page ]