AndrewUWUT

I am trying to create my own articulated arm (a seven degree of freedom Schunk manipulator) using the MSRS simulation environment, by following the example contained in SimulationTutorial #4 (which creates a kuka 7 DOF arm and lets you control it through a dashboard).

I have located the Entities.cs file, which contains all of the source code for the example entities that come with a download of MSRS. I have copied over the class "public class KukaLBR3Entity : VisualEntity" to my own project, and I was hoping to subtely change the code contained there to create my model, since they are similar manipulators and the majority of the changes would be in the shape of the links. However, when I attempt to build my new class, I get the error:

error CS0117: "Microsoft.Robotics.Simulation.Engine.VisualEntity" does not contain a definition for 'LocalToWorld'

Looking at the API available for VisualEntity, this is true; no LocalToWorld appears to exist, and I can not find a definition for it in the KukaLBR3Entity class either, or any of the classes which VisualEntity derives from.

Because I can only view the Entities.cs file as a source file (I can not find the project it is used with which builds SimulationEngine.dll, used in SimulationTutorial #4) I can not tell where this reference to LocalToWorld is resolving to in that source code.

I'm most experienced in C++ programming, and am thus learning C# as I go, so there is a possibility I am missing a subtlety here for finding this definition. Does anybody have any ideas Is there perhaps a version problem and this is an outdated method/member variable that has changed names Am I perhaps missing a reference/using statement in my project due to my inexperience with C#

Any help would be greatly appreciated....

Thanks!

-Andrew


Re: Microsoft Robotics - Simulation LocalToWorld attribute/definition in VisualEntity?

KyleJ - MSFT

Hi Andrew,

This method is present in the simulation engine definition for VisualEntity but it is not part of the source code that we have made public. It is marked internal so it is not visible to external developers. This is a bug because we intend the code in entities.cs to be copied and modified just as you are doing.

This method returns a matrix which can be used to transform coordinates from a local reference frame to world coordinates based on the pose and Position of the local entity.

I will fix the simulation engine so that this method is publicly visible and I have included the source code for it below. You can probably get away with deleting the entire If clause under the comment "Update arm position & orientation ..." because it is only used to make the arm behave nicely when the simulation editor is moving it around.

I am working on a simplified version of the Kuka arm that I will post in the next few days.

-Kyle

Code Block

internal xna.Matrix WorldToLocal
{
get
{
return xna.Matrix.Invert(LocalToWorld);
}
}

internal xna.Matrix LocalToWorld
{
get
{
xna.Matrix localToWorld = xna.Matrix.CreateFromQuaternion(TypeConversion.ToXNA(State.Pose.Orientation));
localToWorld.Translation = Position;

if (Parent == null || (_parentJoint != null && _parentJoint.InternalHandle != IntPtr.Zero))
{
return localToWorld;
}
else
{
return localToWorld * Parent.LocalToWorld;
}
}
}





Re: Microsoft Robotics - Simulation LocalToWorld attribute/definition in VisualEntity?

AndrewUWUT

Thanks Kyle, appreciate it!

-Andrew




Re: Microsoft Robotics - Simulation LocalToWorld attribute/definition in VisualEntity?

Ben Axelrod [CoroWare]

When can we expect some updated simulation assemblies with these bug fixes

Thanks,
-Ben