Here is a detailed list of what's new and changed in Microsoft Robotics Developer Studio 2008 CTP April.


Samples

We have expanded the collection of samples to include a variety of new samples demonstrating features such as:

Various enterprise-style service scenarios including load balancing and log synching (see Enterprise Samples Overview)
A new service tutorial demonstrating how to use the DSS Manifest Editor (see Service Tutorials Overview)
Interoperability with Windows devices using the C++/CLI model provided by CLR (see Technology Samples Overview)
Concurrency and Coordination Runtime
New Features / Bug Fixes
Stronger guarantees for the interleave.Teardown group
Causalities flows with EnqueueTimer
DispatcherQueue.ExecutionPolicyNotification added to captured discarded tasks when policy limits are exceeded
Iterators can nest with no need for ExecuteToCompletion
ICausality interface added and all Dispatcher APIs are now changed to accept it. The Causality class remains the only concrete implementation
Ccr.Adapters.IO.dll provides CCR adapters for asynchronous stream reading and writing.
Breaking Changes
Dispatcher.ActiveCausalities now returns ICollection<ICausality> not ICollection<Causality>
Decentralized Software Services
New Features / Bug Fixes
DSS supports starting nodes with TCP only (no HTTP port needs to be specified) and also support randomly choosing a port if /tccport:0 is specified. This works from DssEnvironment as well as from DssHost
DSSP Operation Port queueing policy support extended to ports to with active receivers within an interleave
New ServiceState attribute for annotating state fields and declaring transform
Fault.ToException() method added for easy conversion of faults to exceptions
Support for implicit Get and HttpGet handling, using DefaultHttpGet and DefaultGetHandler methods for all services using the ServiceState attribute to identify the service state member.
SubscriptionManager now available as a tightly coupled service, speeding up notification handling and enabling direct state manipulation/change event handling
DsspServiceBase.TransformToProxy and DsspServiceBase.TransfromFromProxy added to enable direct cloning of service state and/or wire types
New concise syntax for request/response in DSSP iterator handlers
DssInfo allows generating static DSS Service Description Directory from service assemblies, used for subscription and discovery
New header, ServiceStatePolicyHeader added to control caching and XSLT transform response
New ServiceHandlerAttribute field added, Interval, that turns a handler periodic with no need for CCR timeout ports
New SubscriptionManagerPartnerAttribute with the default arguments used for subscription manager partners (much more concise)
Service creation has been optimized so that it now is 5-10 times faster than in previous versions.
Breaking changes
ContractDirectory state changed. RemoteSearch field removed, LocalSearch modified to LocalServicePaths
ContractDirectory RegisterRemoteDirectory and UnRegisterRemoteDirectory operations removed
ContractDirectory SearchRemoteDirectories field removed from QueryContract operation body
DsspServiceBase.ExceptionToFault removed from DsspServiceBase. Fault.ToException should be used instead
HttpGet added to all RoboticsCommon generic contracts
ConsoleOutput service state type changed to use Queue<MessageType> instead of List<MessageType>. This breaks only code and XLSTs that directly parsed XML from the console service. Code using the QueueType.MessageList as a collection is not affected
DSS Security Model - Message Level Authorization
DSS now supports Message Level Authorization

Overview

Message Level Authorization is a Security mechanism that allows a security policy to specify which users can perform what actions on which services.

DSS allows a service to be reliably identified in two ways: firstly, by service path – which allows the identification of specific instances of a service; secondly, by contract identifier – which allows the identification of all instances of a specific service, or all instances of service ports implementing a specific contract.

At the same time, every DSS Message has a defined Action Verb, and well written services will implement their message handlers to obey the semantic restrictions of the specified verbs.

These two characteristics allow the creation of a meaningful security policy, without needing to know the detailed semantics of each message of every service.

By creating the concept of a Role, which combines a list of Users with a list of Services and a set of permissions, a sophisticated policy can be expressed in an easily understood and easily managed way.

Details

When authorization is enabled every message to a service port is associated with a user. A DSSP message contains, among other information, a target service port, an action verb and a body.

Authorization is defined as “Can Subject do Action to Object?”

Where the Subject is a SID, the Action is a DSSP Verb and the Object is a DSS Service Port.

Direct Definition

A single service instance can be identified by a service path and all instances of a given service are identified by the service contract identifier.

Permissions can be directly defined in terms of either a service path or a service contract. When the DSS security infrastructure determines whether a user has permission to perform an action it looks up the permissions defined for the target service either by path or by contract.

Security Roles

The Service Permissions section allows policy to be specified on a per service path basis. This allows policy to be specified for a specific instance of a service.


The Contract Permissions section allows policy to be specified on a per Contract basis. This allows policy to be specified for all instances of a service.


The Security Roles section allows roles to be specified. As described above a role is a list of users, a list of service paths, a list of contracts and a set of permissions. These are summarized for each defined role in the U, P, C, Allow and Deny columns of the table.


Existing roles can be edited using the appropriate Edit button. New roles can be defined by entering a name in the New Role Name text box, and pressing the Add button.

Breaking Changes

The security model has changed dramatically. Security settings files that were created using previous versions will not work.
Visual Programming Language / DSS Manifest Editor

New Features

Error Checking

Like in any other programming environment users can make errors when creating diagrams with the Microsoft Visual Programming Language (VPL). If a project has many custom activities, these errors may be on diagrams that are not currently shown. This makes it hard to find out why the application wont run or compile. VPL has a new toolbox (View / Toolboxes / Error menu) that shows all errors in the project, not just the ones that are on the active diagram. Clicking on the error description highlights it in the diagram or double clicking opens the diagram that contains the error.


Distributed Applications


The Visual Programming Language and the DSS Manifest Editor now enable users to divide up their application to run on multiple DSS nodes, either on the same machine or across the network. When an application containing multiple nodes is to be started, VPL creates individual deploy packages for each node and fires them up across the network. This provides VPL/DSS Manifest Editor users with a very powerful tools that dramatically simplifies the task of creating and deploying applications in a distributed environment.

VPL can make any application a distributed application. The feature is accessible by double clicking on the Nodes entry in the Project toolbox.





The DSS Manifest Editor now supports a new project type Distributed Application


Code Generation


The way C# service projects are generated from VPL diagram has been improved. VPL can now generate projects for Visual Studio 2008 (default) and Visual Studio (2005).

A DSS service is generated for every custom activity in an application. This includes top-level diagram. Often users are only interested in the services for the custom activities but not the top-level diagram. These can now be excluded from code generation.

Users now have better control over the month and year that is used to generate the service contract identifier.


Improvements and Bug Fixes

vpl <filename>
or
dssme <filename>
with a file that doesn't exist will now ask user whether to create file
Better support for simulation services in the DSS Manifest Editor. If a simulation engine is present, users can browse the selection of entities when setting the entity partner of a simulation service.
Deleting an activity now only creates one undo step.
Support inline lists in initial state editor
The internal DSS node doesn't need pre-assigned port numbers. This makes it easier to run multiple instances of VPL/DSS Manifest Editor
Custom acitvities can have user defined icons
The service URI of a partner service can be specified directly in the DSS Manifest Editor
Numerous smaller bug fixes
Breaking Changes
Projects that have been edited with VPL 2.0 cannot be opened with VPL 1.5. VPL 2.0 will show a warning before opening old projects.
New Visual Simulation Environment (VSE) Features in CTP1
New Features / Bug Fixes
Record and Playback Capability

The simulator now has the ability to record the position and orientation of each entity and to save that information to a file. The file can later be replayed.

The Playback Toolbar can be displayed by selecting Playback Bar option from the View menu. The record button is the button with the red circle on the left. Pressing this button will cause the simulator to save the current simulation state and immediately begin recording the position and orientation of each entity in the scene each frame. The stop button contains a blue square. Clicking this button while the simulator is recording causes the recording to stop. The simulator will prompt for a filename with a default .plb extension. The recorded data is saved to the file in a gzip compressed XML format.

The play button contains a blue triangle pointing to the right. Clicking this button while no playback is currently in progress causes the simulator to prompt for a filename to load playback data. The data is loaded from the specified file and a trackbar is displayed to show the playback progress. The simulator replaces its current state with the state in the playback file. This means that the entities in the simulator before playback are deleted and replaced with the entities in the playback file. The simulator plays back the recorded position and orientation information for each entity. The data is interpolated so that the motion of the entities is smooth even if the frame-rate during playback is different than when the file was recorded. Since only position and orientation data is recorded, changes such as adding new entities to the scene or changing other attributes of entities such as color or texture will not be recorded.

The Pause button contains two vertical bars. Pressing this button during playback will pause the playback. Dragging the trackbar to the left or right quickly scans through the playback file. Clicking Play again will resume the playback. When the playback reaches the end, it is paused and clicking Play will cause the playback to resume from the beginning. At any time during playback, clicking the Stop button will stop playback and unload the data from memory.

While a playback is in progress, the cameras in the scene are controlled by the playback data. However, left-clicking on the render window will disengage the current camera from playback so that the scene can be observed from a different vantage point from where it was recorded. The next time the playback is started from the beginning, the camera will again be bound to the playback data.

Recording and playback can also be started and finished by sending a message to the Simulation Engine service as shown in the following sample code:


Embedded Media Resources


Media resources such as texture maps, bitmaps, and mesh files are usually files that reside in the store\media directory. In some cases it is desirable to embed these resources in a service rather than leaving them in discrete files.

The steps to add a file to a service as an embedded resource are outlined in Service Tutorial 6. In a nutshell, you add the file to your service project and in its properties, you set the Build Action to embedded resource. When the service is started, the embedded resources are made available to other DSS services such as the Simulation Engine Service.

The next time the simulation engine needs to load a media resource, it will first attempt to find the media file in store\media. If it cannot be found there, the simulator will attempt to load it as an embedded resource. The first time an embedded resource load is attempted, the simulator waits for the resource to become available for a period of time specified as a number of milliseconds in the <EmbeddedResourceLoadTimeoutMS> item in the SimulationEngine.config.xml file in the config directory. This allows the embedded resource service to be started in a manifest along with the Simulation Engine service and avoids race conditions as the services start up.

The simulator can help you define a service that contains embedded media resources. Select Create Embedded Resources from the File menu. The simulator prompts for a directory and project name for the service to be created and then creates a service that contains every media resource currently in use by the simulator as an embedded resource. This service can then be built and included in a DssDeploy package with other services and the individual media files will not need to be included in the package.

Sprites


While most objects in the simulation environment are three-dimensional, it is sometimes useful to have two-dimensional labels or billboards. The new SpriteEntity can be used for this purpose. A SpriteEntity is a two-dimensional texture-mapped rectangle that can be positioned and oriented in the simulation environment like any other entity. Because it does not have a physics shape associated with it, it does not collide with other entities in the environment.

A Sprite Entity can be fixed in space or it can pivot to face the active camera. If it pivots, it can be set to pivot about its center point or to pivot around its Y axis.

The texture map associated with a SpriteEntity can be easily modified. The GetBitmap method returns a bitmap with the proper dimensions and pixel format to match the texture on the sprite. After the bitmap has been drawn on, it is passed back to the SpriteEntity using the SetBitmap method and it is copied to the sprite texture map and appears on the screen.

The SpriteEntity source code appears in entities.cs so it is easy to create specialized sprites that inherit the SpriteEntity functionality. Two such sprite entities have already been provided. The CameraSpriteEntity is designed to be a child entity of a CameraEntity. It displays the image currently seen by the camera. The EntityNameSprite is designed to be a child entity of any other entity and it displays the name of that entity. Source code for these two entities is also provided in entities.cs.


Context Menu


Several commonly used simulation editor commands are now available on a context menu. When the right mouse button is clicked in the rendering window, the entity under the mouse click is selected and the context menu is displayed. If no entity is under the mouse click, none of the entities in the scene are selected. The context menu has the following options:

Action Description
Cut
Remove the currently selected entity and put it in the Simulation Editor paste buffer

Copy
Put the currently selected entity in the Simulation Editor paste buffer

Paste
Copy the entity currently in the simulation editor paste buffer into the simulation scene

MoveXZ
Constrain the movement of the selected object to be in the XZ plane

MoveX
Constrain the movement of the selected object to be in the X direction

MoveY
Constrain the movement of the selected object to be in Y direction

MoveZ
Constrain the movement of the selected object to be in the Z direction

MoveXYZ
Allow the selected object to move in any direction

RotateX
Constrain the rotation of the selected object to be around the X axis

RotateY
Constrain the rotation of the selected object to be around the Y axis

RotateZ
Constrain the rotation of the selected object to be around the Z axis

RotateXYZ
Allow the selected object to rotate freely around all axes

NewEntity
Display the NewEntity dialog box



Mesh Entities

Every entity can have a custom mesh that represents it visually. Some entities such as the SimplifiedConvexMeshEnvironmentEntity and the TriangleMeshEnvironmentEntity build their physics shapes from their visual mesh. A new Mesh entity has been defined to generalize this idea. A mesh entity must have a custom mesh .obj or .bos file specified in its State.Assets.Mesh field. When it is initialized, it will create an entity with specified visual mesh and also a physics shape based on one of the following values in its MeshEntityType field:

Box
The physics shape is a box the same size as the bounding box of the custom mesh.

Sphere
The physics shape is a sphere the same size as the bounding sphere of the custom mesh.

Convex
The physics shape is a convex mesh built from the custom mesh.

Triangle
The physics shape is a triangle mesh which is exactly the same as the custom mesh.


Additional MeshEntityTypes will likely be added in the future.


Floorplan Editor

Creating complicated structures and interior simulation scenes has been difficult in the past. In this release, the FloorplanEntity and a new 2D editing tool have been provided to make this easier. The FloorplanEntity holds a collection of wall items, door items, and window items that that can be combined to represent the interior of a room, house, or other building.

To begin defining a new floorplan start the simulation editor by selecting Edit from the Mode Menu. Create a new FloorplanEntity by selecting New... from the Entity menu and then selecting the FloorplanEntity, giving it a name, and pressing OK. Select an initial position for the floorplan and press OK to create it. The new entity should appear with a check in the upper-right entities pane. Press the Edit Entity button to edit the floorplan entity. A 2D representation of the world appears in the render window and several buttons that represent floorplan items appear in the entities pane. Press the Wall button to create a new wall item. It appears in the render window with a red and green handle on each end. It is white on the interior to indicate that it is currently selected. Drag the left mouse button outside of the item to move the 2D map around. Drag the right mouse button to scale the map larger or smaller. Click inside any floorplan item to select it. Click and drag the interior of an item to drag it to a new location. Click and drag the red handle to grow or shrink that end of the item and likewise with the green handle. Press the left control key and the square handles change to circles indicating that the angle of the item can now be changed. Now drag the handles to change the size and angle of the entity. The position of each handle and the angle of the item are displayed at the top of the rendering window for the selected item. Pressing ctrl-C while an item is selected causes it to be duplicated. Pressing delete while an item is selected causes it to be deleted.

The FloorplanEntity properties define the width and height for the floorplan items. A snap grid can be defined to help the walls to fit together properly. The spacing of the snap grid should be set to one half or one fourth the width of the wall. A building floorplan with more than one wall width or height can be defined using multiple floorplan entities.

Often, you will want to construct a floorplan based on a 2D floorplan image or CAD drawing. The floorplan entity allows an underlay image to be specified. Any image format such as .bmp, .jpg, or .tiff that is supported by GDI can be loaded. Also specify a scale for the image to determine how big it will appear in the 2D map. Select the desired wall thickness and create a wall item and then scale the underlay image so that the walls displayed in the image match the size of the wall item.


When you press the OK button, the FloorplanEntity is refreshed and physics objects and meshes are constructed to reflect the FloorplanEntity items. The Floorplan entity can be rotated or moved just like any other entity. Additional functionality will be provided in the future to specify floor tiles and texture maps for the walls. A sample floorplan scene can be loaded by selecting House Floorplan from the Start Menu under the Visual Simulation Environment menu.


Breaking Changes

Change in Shape LocalPose orientation

A bug in the Visual Simulation Environment in versions 1.0 and 1.5 caused the orientation quaternion in the LocalPose field of each shape to be interpreted incorrectly. The inverse of the rotation was used. If you are porting entities from MSRS 1.0 or 1.5 to the CTP1 release of MSRS 2.0, and you have used the LocalPose orientation field to rotate a shape within an entity, you will need to negate the W component of the quaternion or use the negative of the angle in an AxisAngle definition. If you fail to do this, shapes with a non-zero LocalPose rotation will be rotated incorrectly.

Change in the PhysicsEntity ApplyLocalForce Method

The methods used to apply forces to an entity have changed as follows:

ApplyForce(Vector3 force) has changed to ApplyForce(Vector3 force, bool forceIsLocal) - The boolean forceIsLocal parameter indicates that the coordinates of the force vector are relative to the local coordinate frame of the entity if it is true. Otherwise the coordinates are relative to the world frame.
ApplyTorque(Vector3 torque) has changed to ApplyTorque(Vector3 force, bool torqueIsLocal) - The boolean torqueIsLocal parameter has the same meaning as in the ApplyForce method.
ApplyForceAtLocalPosition(Vector3 force, Vector3 position) has changed to ApplyForceAtPosition(Vector3 force, Vector3 position, bool forceIsLocal, bool positionIsLocal) - where the two boolean parameters indicate whether the force and position are in the entity local coordinate frame or in the world coordinate frame.
These methods specify a force or torque that is applied to the entity for the duration of the coming frame. This method must be called each frame in the Update method if a constant force or torque is desired. The ApplyForce method applies a force at all points on the entity and therefore generates no torque. The ApplyForceAtLocalPosition method applies the force at a specific position and can therefore generate torque on the entity.