Problem in Boe-Bot service

We detected a regression with nullable types in DSS core that causes nullable values not to be delivered correctly through proxies. This issue will be fixed in the next release, however for now it’s affecting a few of our services that use nullable types when messaging. The workaround is to replace the nullables with valuetypes, but anyway this will not fix the problem completely where null and zero are treated differently.

To remove nullables in Boe-Bot services:

Open samples\Platforms\Parallax\BASICStamp2.sln in Visual Studio

In MotorSpeed class (in BasicStamp2Types.cs) remove the question marks from in front of double types.

In SetMotorPowerHandler (in BSMotor.cs) comment out the following lines:

motorSpeed.LeftSpeed = null;

motorSpeed.RightSpeed = null;

In SetCoordinatedMotors (in BasicStamp2.cs) change null assignments to assign to 0 and in if statements remove the check for null values. Do the same for UpdateMotorSpeedHandler.

Again this does not fix the problem completely and sometimes one motor will work but not the other. You can temporarily pick another value outside the [-1, 1] range to replace nulls but a better solution would be to use custom nullable types. To see a sample, download Microsoft Sudoku [1] and see the source files in the "Nullables" folder.

[1] Microsoft Sudoku

http://www.microsoft.com/downloads/details.aspx?FamilyID=c0461e1a-bd6a-4b21-a199-d3d4f9d79cf7&DisplayLang=en

Omid

[3011 byte] By [OmidK.Rad] at [2008-2-2]

Microsoft Robotics Studio

Site Classified