Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Joint::childLink not loaded correctly #943

Closed
osrf-migration opened this issue Nov 7, 2013 · 10 comments
Closed

Joint::childLink not loaded correctly #943

osrf-migration opened this issue Nov 7, 2013 · 10 comments
Labels
all blocker bug Something isn't working physics

Comments

@osrf-migration
Copy link

Original report (archived issue) by John Hsu (Bitbucket: hsu, GitHub: hsu).


Currently Joint::LoadImpl has an error in its logic such that if parentLink is not NULL, childLink is not assigned. This is done in error, the code should look like below:

hg diff gazebo/physics/Joint.cc 
diff -r 3cafd154f538560150bda6ab3468ccfb35f70ca8 gazebo/physics/Joint.cc
--- a/gazebo/physics/Joint.cc	Thu Nov 07 10:51:37 2013 -0800
+++ b/gazebo/physics/Joint.cc	Thu Nov 07 12:05:44 2013 -0800
@@ -159,9 +159,11 @@
 
   if (this->parentLink)
     this->parentLink->AddChildJoint(boost::static_pointer_cast<Joint>(myBase));
-  else if (this->childLink)
+
+  if (this->childLink)
     this->childLink->AddParentJoint(boost::static_pointer_cast<Joint>(myBase));
-  else
+
+  if (!this->parentLink && !this->childLink)
     gzthrow("both parent and child link do no exist");
 
   // setting anchor relative to gazebo child link frame position
@osrf-migration
Copy link
Author

Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu).


pull request #772 has a fix 9b5e7e8.

we need a separate pull request for gazebo 1.9.

@osrf-migration
Copy link
Author

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


This definitely looks wrong, but it also looks like it was done on purpose. Is there a scenario in which the original code fails?

@osrf-migration
Copy link
Author

Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu).


For example, for a robot like atlas, any of the robot's joints Joint::GetParent() will return an empty pointer, but we expect each (except pelvis) of the links in the robot to have a parent link. Example test usage, without this fix, parent is NULL in this test except for the joints that attach each foot to the world.

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


I don't think it was done on purpose. I think I just botched the logic in pull request #329. We should add a test for this (maybe somewhere in Joint_TEST).

@osrf-migration
Copy link
Author

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


Nice detective work. I retract my concern.

@osrf-migration
Copy link
Author

Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu).


pull request #820 for gazebo_1.9, after that, we should merge it downstream into gazebo_2.0, gazebo_2.1 and default.

@osrf-migration
Copy link
Author

Original comment by John Hsu (Bitbucket: hsu, GitHub: hsu).


merged pull request #820
created pull request #833 as a reminder to merge gazebo_1.9 into gazebo_2.0

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


  • changed state from "new" to "resolved"

pull request #820 and pull request #833 have both been merged.

@osrf-migration
Copy link
Author

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


  • set version to "all"

@osrf-migration
Copy link
Author

Original comment by Nate Koenig (Bitbucket: Nathan Koenig).


  • changed state from "resolved" to "closed"

@osrf-migration osrf-migration added blocker physics bug Something isn't working all labels Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
all blocker bug Something isn't working physics
Projects
None yet
Development

No branches or pull requests

1 participant