This file is part of
the Microsoft Robotics Studio Code Samples. Copyright © Microsoft
Corporation. All rights reserved.
Updated Nov-2007 by Trevor Taylor, Software Technology, Australia
The Lynx6Arm service is a Decentralized System Service (DSS) that connects to a Lynxmotion Lynx 6 Robotic Arm via a Lynxmotion SSC-32 Servo Controller over a serial port connection. The service has a service partner, the SSC32 service, that sends commands to the servo controller. The Lynx6Arm service implements the generic ArticulatedArm contract in RoboticsCommon as an alternate contract.
· A Lynxmotion Lynx 6 Robotic Arm.
· A Lynxmotion SSC-32 Servo Controller with the SSC-32 Firmware loaded.
· A serial port (currently COM1 -- you must edit and recompile the service to change this).
Note: The Lynx6Arm service assumes that the robotic arm is connected to the controller as described below, not in the manner described by the Lynxmotion Assembly Guide. In particular, the servos are connected as in the table below:
SSC-32 Servo Number | Arm Servo Function |
0 | Base Rotate |
1 | Shoulder |
2 | Elbow |
3 | Wrist |
4 | Wrist Rotate* |
5 | Gripper* |
* These two are reversed compared to the Lynxmotion documentation. It does no harm if you get them wrong, but they will not work as expected.
Start the Microsoft Robotics Studio Command Prompt from the Programs menu.
Connect the robotic arm to the controller and plug the servo controller into the serial port.
Start a DssHost node and create an instance of the service by typing the following command:
dsshost /p:50000 /m:"ProMRDS/Config/Lynxmotion.Lynx6Arm.manifest.xml"
This will start the service and you get a response like this:
Initializing Dss Node with manifest file: .../ProMRDS/Config/Lynxmotion.Lynx6Arm.manifest.xml
If you prefer, you can use a command procedure that starts both the arm and a simple Dashboard. The Dashboard has the ability to change the angle of one joint at a time, so you can use it to test the Lynx6Arm service. To run the command procedure, at the MRDS command prompt type:
RunLynx6Arm
Please note: At start up, the service automatically sends a positioning command to the arm, initializing all the servos on the arm to an angle of 0 degrees. The movements may be sudden and the arm will probably jerk. It helps if the arm is roughly in the startup position when you turn the power off so that it does not have far to go the next time you want to use it.
Start Internet Explorer (IE) and type the "Service uri" specified in your command prompt. For example:
http://localhost:50000/lynx6arm
This will display the Lynx6Arm service running on your node. You will be able to see the current state of the 5 joints and gripper of the arm.
The Lynx6Arm service represents the physical robotic arm as a list of joints, implementing the contract defined in ArticulatedArmState. The 5 joints of the arm are defined in a serial order from the base to the wrist rotate. Each joint has only one degree of “twist” angular freedom and a range from -90 degrees to 90 degrees about the joint axis. The joint axis and joint normal are designated using the left-hand coordinate system. If you would like more details about describing the properties of a joint, you should review Simulation Tutorial 4.
Below we provide a graphical representation of the Lynx6ArmConfiguration used in the service. Note that the Lynx6ArmIK service (Inverse Kinematics) that originally shipped with the software has been removed. Instead the calculations are done inside the Lynx6Arm service itself.
The Lynx6Arm service supports all of the operations defined in the generic Articulated Arm service that shipped with MSRS V1.5. This includes the Get operation to get the joint names and angles, and the SetJointTargetPose operation to move a single joint. Joint angles are specified in degrees. There are hard-coded limits on the joint angles to prevent you from accidentally damaging the arm. Some joints therefore do not have the full -90 to +90 degree travel when using this service.
Servo | Zero Position | Positive Direction (increasing angle) |
Base | Facing away from SSC-32 | Clockwise (right) |
Shoulder | Vertical | Lean backwards |
Elbow | Right angle to upper arm* | Bend down |
Wrist | In line with lower arm | Bend up |
Wrist Rotate | Horizontal | Anti-clockwise (left) |
* If you look carefully at the elbow, you will see that it is connected to the lower arm with an offset of 20 degrees. The service compensates for this so that an angle of zero will be a right angle with the upper arm.
The following two operations work in a world coordinate frame: GetEndEffectorPose and SetEndEffectorPose.
IMPORTANT NOTE:
The coordinate frame used by this service does not conform to the Lynxmotion
standard. As long as you use coordinates from GetEndEffectorPose as input to SetEndEffectorPose
this does not matter. The coordinate system is shown in the figure below and is
defined as follows:
Sit at the left-hand side of the Lynx 6 arm facing the switch and serial port plug.
The origin is at the center of the base at gound level.
The X Axis runs from left to right.
The Y Axis runs upwards.
The Z Axis comes out towards you.
In this coordinate frame, the X coordinate values will always be negative!
The GetEndEffectorPose operation will return the current Pose (orientation and position) of the end effector. The end effector pose originated at the base of the gripper and is described using a right-handed base coordinate frame. Through the SetEndEffectorPose operation, you can specify a Pose (in the right-handed base coordinate frame) for the end effector and the service will move the arm to the desired pose. For more information on the inverse kinematics, please read the code.