Visual Servoing
Many applications require aligning the arm end effector with respect to some (possibly moving) visual reference. Visual Servoing is a technique commonly used in these cases.
This how-to guide demonstrates an advanced Visual Servoing example that uses the PoseJog
Behavior to track and intercept a moving satellite in space.
Setup
For this example, we use the space_satellite_sim
configuration which demonstrates visual servoing with a moving target.
To launch this configuration, run:
moveit_pro run -c space_satellite_sim
Example: Grapple Moving Satellite with State Estimation
The Grapple Moving Satellite with Fuse
Objective demonstrates visual servoing by tracking and intercepting a moving satellite using state estimation from AprilTag detection.
This Objective shows how to:
- Track a moving target using odometry information
- Compute velocities to align with the target in real-time
- Use
PoseJog
for safe, smooth Cartesian motion control - Maintain continuous visual servoing until alignment is achieved
Key Behaviors
The main Behaviors involved in this visual servoing approach are:
-
ComputeVelocityToAlignWithTarget
: Computes the Cartesian velocities needed to align the end effector with a target pose. It takes into account the target's motion state and applies proportional gains to generate smooth control commands. -
PublishVelocityForceCommand
: Publishes velocity and force commands to the robot's velocity-force controller. This Behavior bridges the computed velocities to the robot's control interface. -
PoseJog
: Provides safe Cartesian teleoperation with advanced features including collision avoidance, singularity handling, and workspace boundary management. Unlike the deprecatedServoTowardsPose
,PoseJog
offers improved safety and control fidelity.
Running the Example
- Edit the space_satellite_sim config.yaml mujoco_viewer param to launch Pro with the MuJoCo viewer.
- Launch the
space_satellite_sim
configuration as shown in the Setup section - In the MuJoCo viewer, load Key 1 (by clicking on Key 0 and dragging to the right) to initiate satellite motion or reset its position
- In the MoveIt Pro web interface, run the "Grapple Moving Satellite with Fuse" Objective
- Observe how the robot tracks and intercepts the moving satellite using visual servoing
The Objective will:
- Open the gripper
- Switch to velocity-force control
- Continuously track the satellite's position using odometry
- Compute alignment velocities and execute them through
PoseJog
- Close the gripper once alignment is achieved
For more details on configuring PoseJog
for your own applications, see the Configure Pose Jog guide.