Raúl
Moderador
 Moderador
| Mensajes: 444 |  | Karma: 6
|
Re:C# Matrix Library for an Articulated Arm - 2008/07/09 18:05
Hi, I was looking for the same stuff some time ago. I had to do plenty of euclidean transformations like rotations, translations, projections, calculate vectors from different reference systems, etc.
I started using the classes defined in Microsoft.Robotics.PhysicalModel (Vector3, Quaternion, Matrix, etc.) to represent objects and locations perceived by my robot. Then, I discovered (thanks to S@ilor for this) that you can have some more functionality if you use the Microsoft.XNA.Framework assembly (which is also shipped with Robotics Studio).
By the way, note the difference between Microsoft.Robotics.PhysicalModel.Vector3 and Microsoft.XNA.Framework.Vector3
Using the XNA Framework you can do things like this:
| Code: | static Vector3 RotatePointOnYAxis(Vector3 point, float angle)
{
// Create a rotation matrix that represents a rotation of angle radians.
Matrix rotationMatrix = Matrix.CreateRotationY(angle);
// Apply the rotation matrix to the point.
Vector3 rotatedPoint = Vector3.Transform(point, rotationMatrix);
return rotatedPoint;
}
|
I don't know of any other C# library for matrix algebra, but I am sure there should be something out there.. I'll let you know if I here of something.
Hope this helps..
Raúl Arrabales Moreno. conscious-robots.com/raul |