After version 1.8.0 (currently 2.1.0) dynamically created joints act unnatural [Resolved] [closed]

asked 2013-11-27 08:13:25 -0600

AndreiHaidu gravatar image

updated 2014-08-03 09:40:47 -0600


I am creating dynamically joints between multiple spheres, by connecting all spheres to a center one. This feature stopped working after version 1.8.0, the joints started acting very unnatural, spheres exploding and stuff. I tried many ways to change parameters when creating the joints, however without any significant changes.

Here is the function used in creating the joints:

void DynamicJointPlugin::CreateDynamicJoint(
        physics::LinkPtr _parent_link, physics::LinkPtr _child_link)
    physics::JointPtr joint;
    math::Vector3 axis;

    // for axis multiple examples tried
    axis = math::Vector3(1,0,0);  

    joint = world->GetPhysicsEngine()->CreateJoint(
            "revolute", this->liquidModel);

    // switched attach order as well        
    joint->Attach(_parent_link, _child_link);

    // for anchor also tried different values, including a default math::Pose
    joint->Load(_parent_link, _child_link, _child_link->GetWorldPose());

    // tried it with multiple values, even commented out
    joint->SetAxis(0,       axis);
    joint->SetHighStop(0,   M_PI);
    joint->SetLowStop(0,    -M_PI);

    // tried with/without

    // tried it commented out and with several other values (no significant changes occured)
    this->pancakeJoints.back()->SetAttribute("stop_cfm",        0,  this->stop_cfm);
    this->pancakeJoints.back()->SetAttribute("stop_erp",        0,  this->stop_erp);
    this->pancakeJoints.back()->SetAttribute("fudge_factor",    0,  this->fudge_factor);
    this->pancakeJoints.back()->SetAttribute("cfm",             0,  this->cfm);
    this->pancakeJoints.back()->SetAttribute("erp",             0,  this->erp);


The sdf of the model including all the spheres are loaded as well dynamically and it looks like this:

<?xml version='1.0'?>
<sdf version='1.4'>
<model name='liquid_spheres'>
    <pose>0.2 0.1 1 0 0 0 </pose>
        <link name='sphere_link_0'>
            <pose>0 0 0 0 0 0</pose>
                <pose> 0 0 0 0 0 0 </pose>
            <collision name='collision_0'>
                            <fdir1>0.0 0.0 0.0</fdir1>
            <visual name='sphere_visual_0'>



Videos about the behavior: 50 spheres, joints created between all of them and a middle sphere, joints created consecutively:

50 spheres, joints created, iteratively, only acts weird after it has been touched by another item:

3 spheres:

2 spheres:

Thanks, Andrei


Problem doesn't appear in newer versions.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by AndreiHaidu
close date 2014-08-03 10:04:10.206445