Home | Tutorials | Wiki | Issues
Ask Your Question
1

Problems creating multiple joints dynamically after version 1.8.0

asked 2013-06-04 08:06:08 -0500

AndreiHaidu gravatar image

Hi,

I have this piece of code to create joints between spheres dynamically, it worked on version 1.8.0 but after installing 1.8.2 / 1.8.4 when I create the joints between more than 5 spheres, it gives no error, but the the model explodes.

Here is the code:

void DynamicJointPlugin::createJoint(physics::LinkPtr _center_link, physics::LinkPtr _ext_link)
{
    math::Vector3 axis,direction;

    // compute the axis
    direction = _ext_link->GetWorldPose().pos - _center_link->GetWorldPose().pos;
    direction.Normalize();
    axis = direction.Cross(math::Vector3(0.0, 0.0, 1.0));

    this->myJoints.push_back(this->liquid_model->GetWorld()->GetPhysicsEngine()->CreateJoint("revolute", this->liquid_model));

    this->myJoints.back()->Attach(_ext_link, _center_link );

    this->myJoints.back()->Load(_ext_link, _center_link , math::Pose(_center_link->GetWorldPose().pos, math::Quaternion()));

    this->myJoints.back()->SetAxis(0, axis);

    this->myJoints.back()->SetAttribute("stop_cfm",0, this->stop_cfm);
    this->myJoints.back()->SetAttribute("stop_erp",0, this->stop_erp);
    this->myJoints.back()->SetAttribute("hi_stop",0, this->limit_stop);
    this->myJoints.back()->SetAttribute("lo_stop",0, - this->limit_stop);
}

What changes should I make so it will work again?

Cheers, Andrei

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-06-04 11:35:19 -0500

nkoenig gravatar image

I created a spheres_links_question branch within the gazebo repo to help address this question.

Take a look at TestPlugin, and spheres.world

The plugin works for me. Could you please modify the code and SDF file to match the error you're seeing?

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2013-06-04 08:06:08 -0500

Seen: 206 times

Last updated: Jun 04 '13