Well I have spent quite a bit of time on this now and have come to some conclusions.
My character needs to grab hold of things, so I wanted a 'max-distance' joint between the shoulder and arm. For grabbing something solid (eg. ladder), it was ok to use a pulley joint because the hand position would never move. By making the other side of the pulley immovable, it becomes a max-distance joint. This required a little fiddling with the Box2d code to accept an immovable object for one side of the pulley. For grabbing something movable (eg. crate, chair), this one-sided pulley idea would not work so I tried the revolute+prismatic+revolute as suggested here. This mostly worked ok but the connection was very spring-like and did not ever seem to settle into a stable state. This could be because of the number of joints between was larger, or because my character's mass was much greater than the 'pin' bodies holding the revolute and prismatic together. Either way, it wasn't really looking very good.
Then I found a really simple way to do it. Before every world step I check the distance between hand and shoulder. If they are too far apart and not joined, I make a normal distance joint between. If they are close enough and joined, I destroy the joint between them. Believe it or not it works quite well, it even worked well enough that I stopped using the pulley idea for non-movable grab points and used this method instead.
When creating the joint, you need to temporarily move one of the bodies so that the distance between anchor points is the right length, create the joint, then move the body back.
For persistent 'max-distance' joints where one side is always non-movable (eg. chandelier hanging from ceiling) I think the pulley idea is still better because there is no over head with making/breaking joints, and it allows for sleeping when nothing is happening. But since there is only one player actor, who is only sometimes joined to other objects, and will never be sleeping anyway, I figure the extra work of making/breaking joints for his arm in these cases shouldn't be too much of a problem.
Here is an example which fits into the testbed. I didn't think it would work very well on long chains but it's... not too bad.
My character needs to grab hold of things, so I wanted a 'max-distance' joint between the shoulder and arm. For grabbing something solid (eg. ladder), it was ok to use a pulley joint because the hand position would never move. By making the other side of the pulley immovable, it becomes a max-distance joint. This required a little fiddling with the Box2d code to accept an immovable object for one side of the pulley. For grabbing something movable (eg. crate, chair), this one-sided pulley idea would not work so I tried the revolute+prismatic+revolute as suggested here. This mostly worked ok but the connection was very spring-like and did not ever seem to settle into a stable state. This could be because of the number of joints between was larger, or because my character's mass was much greater than the 'pin' bodies holding the revolute and prismatic together. Either way, it wasn't really looking very good.
Then I found a really simple way to do it. Before every world step I check the distance between hand and shoulder. If they are too far apart and not joined, I make a normal distance joint between. If they are close enough and joined, I destroy the joint between them. Believe it or not it works quite well, it even worked well enough that I stopped using the pulley idea for non-movable grab points and used this method instead.
When creating the joint, you need to temporarily move one of the bodies so that the distance between anchor points is the right length, create the joint, then move the body back.
For persistent 'max-distance' joints where one side is always non-movable (eg. chandelier hanging from ceiling) I think the pulley idea is still better because there is no over head with making/breaking joints, and it allows for sleeping when nothing is happening. But since there is only one player actor, who is only sometimes joined to other objects, and will never be sleeping anyway, I figure the extra work of making/breaking joints for his arm in these cases shouldn't be too much of a problem.
Here is an example which fits into the testbed. I didn't think it would work very well on long chains but it's... not too bad.