How-to
Planning a 7-DOF Robot Arm With a Rotary Stage Axis
Short answer
Put the stage into the arm's URDF as a seventh joint, publish JointState for all seven joints, give the stage its own FollowJointTrajectory action server, and map each joint group to its controller in the MoveIt configuration. That earns planning across the whole chain. Never assume the stage stays synchronized with the robot controller: command the stage to its angle, wait for the action result, then run the arm move.

On this page
A rotary stage under a six-joint arm buys you planning reach, not synchronized motion — plan for one, sequence for the other. Put the stage into the arm's URDF or xacro as a seventh joint, publish JointState for all seven joints, and expose a FollowJointTrajectory action server for the stage beside the arm's existing one. Map each joint group to its controller in the MoveIt configuration, and MoveIt plans across the full chain. Never assume the stage stays time-aligned with the robot controller: a stage driven over USB by its own driver carries no timing guarantee, so command the stage to its inspection angle, wait for the action result, then run the arm move.
Model the stage and the arm as one kinematic chain #
Build one link-and-joint tree that contains both machines. Make the stage's rotation link the root: base frame, stage rotation joint, stage table, arm base, the arm's six joints, then the camera. Transforms then originate at the stage frame and reach the arm and the inspection point through the relationship you actually bolted together — fudge a mounting offset here and every plan inherits it.
Choose the joint type from the stage's mechanics, not from convenience. A stage with end stops gets a revolute joint with position limits from its own datasheet; only a stage that truly rotates without stops gets a continuous joint. Enter the stage's velocity limit as well, because the planner scales trajectories against it. This is the same counting discipline as counting real axes before selecting a gantry motion controller: count every joint the planner will command, then build the model and the software around that count, not around the arm alone.
Check the model before any hardware moves: a 6-DOF arm simulation that compares the URDF with the math model shows frame and offset mistakes while they are still free to fix.
Publish state for all seven joints #
MoveIt plans only over joints it can see, and it needs two things from you: current state for every planned joint, and a command path for every joint you want executed. State first. The arm's driver keeps publishing its six joints exactly as it does now — whether or not it speaks ros_control is irrelevant to the planner. Your stage hardware_interface publishes the stage angle through its joint state publisher, with a joint name identical to the URDF, character for character.
Confirm it in the planner's visualization before anything else: jog the stage a few degrees and watch the modeled arm and camera ride the table. If the model sits still while the stage turns, the name does not match or the message is not reaching the planner — every later step depends on this one.
Give the stage its own trajectory action #
State visibility lets MoveIt plan; a command path lets it execute. The stage needs a FollowJointTrajectory action server of its own. You already run a hardware_interface with a position controller for the stage, so the short path is to load a joint_trajectory_controller on top of that interface — it provides the action server, and no new driver code is required.
Leave the arm's side untouched. Its driver keeps its own protocol, its own connection, and its own trajectory action, and the two systems never merge at the driver level. Two action servers, one per joint group, is the architecture. A single goal naming all seven joints would need one controller that owns all seven and a shared execution clock, and that is exactly what you do not have between a robot controller and a USB-driven stage.
Assign each joint group to its controller #
The bridge between the two machines is configuration, not code. In the .yaml files in the config directory of your MoveIt configuration package, declare which joints the arm's trajectory action controls and which joint the stage's action controls. Then compare joint names in three places: URDF, published JointState, and the controller configuration. If they disagree, planning still succeeds while execution routes only the joints it can match — the classic symptom is a plan that previews perfectly and then moves five of seven joints. Names matched, the planner hands each goal to the action server that owns its joints and nothing else moves by accident.
Sequencing a 90 degree stage move with a 2 second arm move #
Inputs, all example values you substitute from your own cell: a stage rotation of 90 degrees to present the part to the camera; a stage point-to-point speed setting of 30 degrees/s read from the stage drive's own configuration; and an arm repositioning move of 2 seconds taken from a plan MoveIt has already produced. The stage speed and the arm time are illustrative inputs for the arithmetic, not measured or documented ratings.
The rule: two independent controllers with no timing guarantee run one move after the other, so the cycle time is the stage time plus the arm time.
The arithmetic: 90 degrees / 30 degrees/s = 3 seconds on the stage; 3 seconds + 2 seconds = 5 seconds for the cycle.
Result: 5 seconds per inspection cycle for these inputs.
Decision: sequence whenever the stage only needs to reach a final position before or after the arm moves — which is exactly what a stage presenting a part to a camera needs. The roughly 2-second premium over a blended move is the price of not assuming synchronization you cannot verify; blended, time-aligned motion exists only if the axis is integrated into the robot controller's own motion system. Until that exists in your controller, sequenced moves are the design, not a workaround. On the stage side, converting commanded degrees into drive counts is the same job as setting gear ratio for degree moves on a rotary servo axis.
Verify the chain before the first planned move #
Run these checks in order; each gates the next.
- State: the planner shows current values for all seven joints; jog the stage and confirm the modeled chain follows.
- Stage-only execution: send a short stage-only trajectory and confirm the action server accepts the goal and the stage reaches the requested angle.
- Split routing: plan a combined move that uses the stage joint, execute it, and confirm the arm joints arrived at the arm's controller and the stage joint at the stage's, with no joint silently dropped.
- Sequence timing: command the stage angle, wait for the action result, start the arm move, and measure the gap between the two moves — that gap is the cycle-time budget from the worked example.
- Collision reality: sweep the modeled stage through its travel with the arm at the work pose, then compare each modeled clearance against a measurement in the cell.
One safety note: the modeled sweep is not a guard. Stage rotation plus arm reach defines a swept volume that neither machine's own limits fully covers, so fence or interlock that volume per the cell's risk assessment before anyone runs the sequence unattended.
Time alignment is the assumption that fails quietly: two controllers that each start on command drift apart under load and buffering, the same mechanism behind why conveyor tracking drifts further from each box. Sequenced moves leave that drift nowhere to accumulate. So the final decision stands as designed: one kinematic model, two action servers, one controller configuration that maps them, and every inspection run stage-then-arm — until the day the stage lives inside the robot controller's motion system, that is the architecture.
Questions asked
Does planning get harder with seven joints on a six-joint arm?
Yes. The chain becomes kinematically redundant, so one camera pose corresponds to many joint combinations and the planner picks one. Expect several candidate solutions and either constrain the stage joint to a preferred range or review the alternatives the inverse kinematics returns, because two valid solutions can place the arm in very different postures over the same part.
Why can't both devices take one combined trajectory goal?
A single goal naming all seven joints needs one action server that owns all seven joints and one execution clock. You have two servers, each with its own driver and its own timing, so a merged goal has no owner. Split the motion into a stage goal and an arm goal and order them; the sequencing lives in your application code, not in the planner.
What tolerance should I use when confirming the stage reached its angle?
Derive it from the inspection, not from the stage datasheet alone. Read the stage angle from its published state, compare it with the commanded goal, and size the tolerance from how much part rotation your camera tolerates. For example, if the inspection tolerates a tenth of a degree of part rotation, that number is the acceptance band for the stage's final position.
Can the robot controller drive the stage directly instead?
Only if that controller class supports integrating external axes into its own motion system, which you confirm with the robot manufacturer for your exact controller. A serial or USB port on the controller that exchanges messages with the stage proves only that communication works; it is not kinematic integration and does not produce coordinated motion. Until such integration exists for your controller, plan and sequence as described here.
