Allowed range for each joint
How can I figure out the accessible range of joint positions for each joint on my PR2?
I became confused while going through the tutorial for moving the torso. The tutorial says in one place that the max torso height is 0.2 and in another place that it is about 0.6. Using the torso controller on my simulated PR2 in Gazebo, I can move the torso to 0.3 but it hangs when I try to move it to 0.4.
From the PR2 manual:
On the PR2, "soft limits" stop the joints from reaching the full range of motion to prevent damage to the mechanism. These soft limits, similar to a virtual spring, are specified in the robot's URDF file.
I found a torso urdf file at /opt/ros/hydro/share/pr2_description/urdf/torso_v0/torso.urdf.xacro
, here's a snippet:
<xacro:macro name="pr2_torso_v0" params="name parent *origin">
<joint name="${name}_joint" type="prismatic">
<axis xyz="0 0 1" />
<limit lower="0.0" upper="0.33" effort="10000" velocity="0.013"/> <!-- alpha tested velocity and effort limits -->
It looks like the torso range should be from 0.0 to 0.33. However, I can't get my Gazebo PR2 to move its torso as low as 0.0, it just goes as low as it can, then hangs. The upper limit seems to be accurate, though. I can move it to 0.33 but not 0.34. I suspect I'm looking at the wrong URDF file.
So several questions here:
- Where can I find my PR2's URDF file?
- Does the simulated PR2 in Gazebo have its own URDF file?
- Is there ever a case where a URDF file is not present? In that case, what determines the allowed range? Will the range be exactly the same for a simulated PR2 as for a physical PR2?
- How can I write code that uses the URDF file to avoid telling the robot to move into physically impossible positions?