18 #ifndef _JOINT_TEST_HH_
19 #define _JOINT_TEST_HH_
24 #include "test/ServerFixture.hh"
27 #include "gazebo/physics/physics.hh"
29 using namespace gazebo;
39 public:
void SpawnJointTypes(
const std::string &_physicsEngine);
52 bool _worldChild =
false,
53 bool _worldParent =
false,
57 std::ostringstream modelStr;
58 std::ostringstream modelName;
59 modelName <<
"joint_model" << this->spawnCount++;
63 <<
"<model name ='" << modelName.str() <<
"'>";
67 <<
" <link name='parent'>"
73 <<
" <link name='child'>"
77 <<
" <joint name='joint' type='" << _type <<
"'>"
78 <<
" <pose>0 0 0 0 0 0</pose>";
80 modelStr <<
" <parent>world</parent>";
82 modelStr <<
" <parent>parent</parent>";
84 modelStr <<
" <child>world</child>";
86 modelStr <<
" <child>child</child>";
89 <<
" <xyz>0 0 1</xyz>"
95 msg.set_sdf(modelStr.str());
96 this->factoryPub->Publish(msg);
102 unsigned int waitCount = 0;
104 !this->HasEntity(modelName.str()))
107 if (++waitCount % 10 == 0)
109 gzwarn <<
"Waiting " << waitCount / 10 <<
" seconds for "
110 << _type <<
" joint to spawn." << std::endl;
113 if (this->HasEntity(modelName.str()) && waitCount >= 10)
114 gzwarn << _type <<
" joint has spawned." << std::endl;
121 joint = model->GetJoint(
"joint");
128 private:
unsigned int spawnCount;