Arm#
Introduction#
This article talks about the rover’s arm. The arm is an important part of the rover and is necessary or helpful to complete a number of URC tasks, including scooping soil for science analysis, interacting with various physical controls, helping the rover get back on its treads in case it falls over, and a variety of other tasks depending on the year.
Controlling a robotic arm is a generally difficult problem, however. The only parts of the arm that a manual arm (human) operator can control are the joint angle values, which makes it very hard for even a seasoned arm operator to perform simple tasks. This method of controlling an arm is named “forward kinematics”, and isn’t recommended for many tasks due to its inability to execute simple tasks in a reasonable timeframe. The software solution to this problem is called “inverse kinematics” (“IK”), which allows an arm controller to specify where the end effector of the arm should go (with various abilities to implement restrictions on the path the arm can take or the orientations allowed during movement), and let the software calculate the joint angles over time necessary to achieve the desired position or movement within the constraints provided.
The implementation of inverse kinematics is why software is so important for the arm to function correctly. Our team’s rover uses the IK library “MoveIt”, which takes care of the joint calculations themselves given some desired end point or arc. (The implementation of IK itself is way beyond the scope of any undergraduate team and presumably involves a lot of complicated math.) Our job is to then call upon this library to plan out motions that we anticipate needing to use in competition, and also provide a way to call upon IK to plan for arm motions that are less easy to anticipate by providing parameters for the desired arc or position.
Code pertaining to the rover arm can be found at
Superproject/controls/src/cmr_arm/arm_control/src/.
Soil scooping#
Soil from a tray of known dimensions (including depth) must be scooped from its initial position into the filter wheel for signs-of-life analysis. An adequate amount of soil is needed for the multitude of tests prepared by the science team, which means that 1. enough soil must be scooped up initially, and 2. the rover arm should not drop too much soil while bringing it to and depositing it into the filter wheel. The general process for scooping soil is broken down into four steps: 1. Put the arm into a pre-defined initial position to prepare it for scooping. 2. Have the arm scoop in a defined arc to acquire soil. 3. Bring the arm scoop from the end of the scooping arc to the filter wheel without dropping soil. 4. Deposit the soil into the filter wheel.
The first step, known as the ready state, is defined by the function switchStateReady(). An arm position was
approximated to fit the initial state criteria and its joint angle values were measured and specified in the
target variable, and the planner then plans and moves the arm into this position. The hard coded target
values can be modified if a better initial position is found.
The second step, known as the active state switchStateActive(), is more complicated, because the arc the
end effector moves in matters (and not just the end position)! The MoveIt library takes in a vector of Poses
and attempts to cycle the arm through the said Poses, stored in waypoints. We decided that a circular scooping
arc would be adequate for scooping soil, and the radius, center (with respect to the arm base), number of poses,
initial angle (going down from the horizontal) and final angle of this imaginary circle arc are specified to
constrain the arm end effector along this arc. Some calculated values are suggested in the beginning of this
function and may be tweaked if the scooping arc isn’t effective. The circular arc may be substituted out for
an arbitrary function in the future so that the arm can be commanded to move through a variety of arc shapes.
The third and fourth step, known as the dumping state, will be defined in switchStateDump() as of current.
This function is currently unimplemeneted and is a TODO for next semester.
The arm_scooping_server calls these functions upon receiving a goal state.
Testing Soil Scooping#
The following should be run to test any new additions to the arm software:
* cmr make compiles any new code.
* cmr --local rover --mock starts a mock instance of the rover on the local machine.
* cmr enable arm-scooping enables the arm-scooping node.
* cmr armview opens rviz to simulate the rover arm.
At this point, the user can simulate the rover arm using defined states in the rviz gui.
If the user would like to test specific functions, the following can be done:
* rosrun actionlib axclient /arm/scoop allows users to call specific functions.