Skip to content

Commit 84221ef

Browse files
committed
Added some extra lines found in github, but still not working
1 parent 0a369b5 commit 84221ef

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ Aborted (core dumped)
5151

5252
Which I've only seen this other useful information: [Bitbucket gazebo removing moving model with ode friction fails](https://bitbucket.org/osrf/gazebo/issues/1177/removing-moving-model-with-ode-friction). But it didn't help me solve my crash. I guess when attaching one model to the other it removes the second one to re-create it attached to the first or something like that.
5353

54+
And also this other issue: [Visualizing dynamically created joints](https://bitbucket.org/osrf/gazebo/issues/1077/visualizing-dynamically-created-joints) made me add a couple of lines more.
5455

5556
The method to attach the links is based on the grasp hack of the Gripper in gazebo/physics:
5657
[Gripper.hh](https://bitbucket.org/osrf/gazebo/src/1d1e3a542af81670f43a120e1df7190592bc4c0f/gazebo/physics/Gripper.hh?at=default&fileviewer=file-view-default)

src/gazebo_ros_link_attacher.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,23 @@ namespace gazebo
7676
this->model = m1; // Store the model we created the joint, just in case
7777
this->fixedJoint = this->physics->CreateJoint("revolute", m1);
7878

79-
ROS_INFO_STREAM("Loading links");
8079
this->link1 = l1; // Store the links too
8180
this->link2 = l2;
81+
ROS_INFO_STREAM("Loading links");
8282
this->fixedJoint->Load(l1,
8383
l2, math::Pose());
84-
ROS_INFO_STREAM("Init");
85-
this->fixedJoint->Init();
84+
ROS_INFO_STREAM("Attach");
85+
this->fixedJoint->Attach(l1, l2);
86+
ROS_INFO_STREAM("SetModel");
87+
this->fixedJoint->SetModel(m1);
8688
ROS_INFO_STREAM("SetHightstop");
8789
this->fixedJoint->SetHighStop(0, 0);
8890
ROS_INFO_STREAM("SetLowStop");
8991
this->fixedJoint->SetLowStop(0, 0);
92+
ROS_INFO_STREAM("Giving a name");
93+
this->fixedJoint->SetName("fixedjoint");
94+
ROS_INFO_STREAM("Init");
95+
this->fixedJoint->Init();
9096
ROS_INFO_STREAM("We are done");
9197
this->attached = true;
9298

0 commit comments

Comments
 (0)