I’m happy to announce the look_at_pose package. We use it to keep a shelf in sight as our robot drives, but it could be used in drones and user interfaces, among other things.
The ROS service takes a current camera pose, a vector to define “up”, and the target pose to look at. The response is a new, upright camera pose that’s centered on the object of interest. Hopefully the documentation here is pretty good.
An example: This camera has a rough initial alignment with the object of interest (the pink cylinder) and it is nearly upside-down. The pose returned from a call to look_at_pose is well-aligned and the camera is upright.