Rotation of object connected with revolute joint

I have an object 'A' connected to object 'B' with a revolute joint.

When 'A' rotates, 'B' rotates along with it as expected. I'm trying to have object 'B' change its angle based on the rotation of A, so it stays consistent. IE if 'B' is pointing upwards when 'A' is at 0 degrees, it will point downward when 'A' is at 180 degrees.

I could update the angle of B whenever A rotates, but I have rotation limits on B.

Any ideas please?
I'm a bit confused about what you mean by rotation limits on B... but, how about applying some torque to rotate B in the direction you want?
I mean limits like it can only rotate between -45 and 45 degrees.

I figured out the problem, I had set the max torque which was preventing object 'B' from rotating along with object 'A'

Original thread: https://box2d.org/forum/viewtopic.php?t=9268