@@ -63,12 +63,22 @@ namespace gazebo
6363 ROS_ERROR_STREAM (link1 << " link was not found" );
6464 return false ;
6565 }
66+ if (l1->GetInertial () == NULL ){
67+ ROS_ERROR_STREAM (" link1 inertia is NULL!" );
68+ }
69+ else
70+ ROS_INFO_STREAM (" link1 inertia is not NULL, for example, mass is: " << l1->GetInertial ()->GetMass ());
6671 ROS_INFO_STREAM (" Getting link: '" << link2 << " ' from model: '" << model2 << " '" );
6772 physics::LinkPtr l2 = m2->GetLink (link2);
6873 if (l2 == NULL ){
6974 ROS_ERROR_STREAM (link2 << " link was not found" );
7075 return false ;
7176 }
77+ if (l2->GetInertial () == NULL ){
78+ ROS_ERROR_STREAM (" link2 inertia is NULL!" );
79+ }
80+ else
81+ ROS_INFO_STREAM (" link2 inertia is not NULL, for example, mass is: " << l2->GetInertial ()->GetMass ());
7282
7383 ROS_INFO_STREAM (" Links are: " << l1->GetName () << " and " << l2->GetName ());
7484
@@ -84,7 +94,21 @@ namespace gazebo
8494 this ->fixedJoint ->Load (l1,
8595 l2, math::Pose ());
8696 ROS_INFO_STREAM (" SetModel" );
87- this ->fixedJoint ->SetModel (m1);
97+ this ->fixedJoint ->SetModel (m2);
98+ /*
99+ * If SetModel is not done we get:
100+ * ***** Internal Program Error - assertion (this->GetParentModel() != __null)
101+ failed in void gazebo::physics::Entity::PublishPose():
102+ /tmp/buildd/gazebo2-2.2.3/gazebo/physics/Entity.cc(225):
103+ An entity without a parent model should not happen
104+
105+ * If SetModel is given the same model than CreateJoint given
106+ * Gazebo crashes with
107+ * ***** Internal Program Error - assertion (self->inertial != __null)
108+ failed in static void gazebo::physics::ODELink::MoveCallback(dBodyID):
109+ /tmp/buildd/gazebo2-2.2.3/gazebo/physics/ode/ODELink.cc(183): Inertial pointer is NULL
110+ */
111+
88112 ROS_INFO_STREAM (" SetAxis" );
89113 this ->fixedJoint ->SetAxis (0 , math::Vector3 (0 , 0 , 1 ));
90114 ROS_INFO_STREAM (" SetHightstop" );
0 commit comments