Merge pull request #55 from YoheiKakiuchi/hydro-devel-fix-joint-axis

joint axis should be rotated depend on local coords
This commit is contained in:
Ioan A Sucan 2014-02-05 14:52:38 -08:00
commit f88200176c
1 changed files with 12 additions and 3 deletions

View File

@ -1022,9 +1022,18 @@ protected:
pjoint->child_link_name = pchildlink->name; pjoint->child_link_name = pchildlink->name;
// Axes and Anchor assignment. // Axes and Anchor assignment.
pjoint->axis.x = pdomaxis->getAxis()->getValue()[0]; {
pjoint->axis.y = pdomaxis->getAxis()->getValue()[1]; Vector3 ax(pdomaxis->getAxis()->getValue()[0],
pjoint->axis.z = pdomaxis->getAxis()->getValue()[2]; pdomaxis->getAxis()->getValue()[1],
pdomaxis->getAxis()->getValue()[2]);
// rotate axis
ax = tatt.rotation * ax;
pjoint->axis.x = ax.x;
pjoint->axis.y = ax.y;
pjoint->axis.z = ax.z;
}
if (!motion_axis_info) { if (!motion_axis_info) {
ROS_WARN_STREAM(str(boost::format("No motion axis info for joint %s\n")%pjoint->name)); ROS_WARN_STREAM(str(boost::format("No motion axis info for joint %s\n")%pjoint->name));