gazebosim / gazebo-classic

Gazebo classic. For the latest version, see https://github.com/gazebosim/gz-sim
http://classic.gazebosim.org/
Other
1.17k stars 477 forks source link

DART collision shapes always have zero rotation #1838

Closed osrf-migration closed 8 years ago

osrf-migration commented 8 years ago

Original report (archived issue) by Dawid Seredynski (Bitbucket: dseredyn).


In the method

#!c++
void DARTCollision::Init()

the code

#!c++
    if (!planeShape)
    {
      math::Pose relativePose = this->GetRelativePose();
      this->dataPtr->dtCollisionShape->setOffset(
            DARTTypes::ConvVec3(relativePose.pos));
    }

should be changed to

#!c++
    if (!planeShape)
    {
      math::Pose relativePose = this->GetRelativePose();
      math::Vector3 pos = this->GetRelativePose().pos;
      math::Quaternion q = this->GetRelativePose().rot;
      Eigen::Isometry3d tf;
      tf.fromPositionOrientationScale(Eigen::Vector3d(pos.x, pos.y, pos.z), Eigen::Quaterniond(q.w, q.x, q.y, q.z), Eigen::Vector3d(1,1,1));
      this->dtCollisionShape->setLocalTransform(tf);
    }

as the orientation of the collision object should also be taken into account.

osrf-migration commented 8 years ago

Original comment by Jeongseok Lee (Bitbucket: jlee02, GitHub: jslee02).


Thanks for reporting! I created pull request #2100 for this.

osrf-migration commented 8 years ago

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


i've added a relevant test in 7f0c218795324f27d067a9645e6323126b279cc2 (branch collision_pose_test_7)

I think the fix can also be back ported to gazebo7

osrf-migration commented 8 years ago

Original comment by Jeongseok Lee (Bitbucket: jlee02, GitHub: jslee02).


I believe this can be closed as addressed by #2100 and #2289.

osrf-migration commented 8 years ago

Original comment by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).


osrf-migration commented 8 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


osrf-migration commented 8 years ago

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).