This is fundamentally no different than getting a differential drive robot to drive straight. You want both sides of the mechanism to end up in the same place at the same time.
In drivetrains people often use a controller that is something like:
Code:
output_steering = PID(steering_error)
output_throttle = PID(distance_error)
left_command = output_throttle + output_steering
right_command = output_throttle - output_steering
PID() could be any feedback (or feedforward + feedback) controller you want, and the steering and throttle controllers would have different gains.
distance_error is usually computed as:
Code:
distance_error = desired_distance - (left_distance + right_distance) / 2
...and steering error could be calculated by a gyro, or by integrating encoder values over time.
This has worked well on hundreds of FIRST robots for driving, and generalizes as a simple way for coordinating two separate mechanisms. You just need to be careful with how you handle saturation/integral windup and you're golden.