-
Notifications
You must be signed in to change notification settings - Fork 22
Introduce batch fk capabilities for floating and planar joints #30
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
base: main
Are you sure you want to change the base?
Conversation
…le batched inputs.
… the DOF of planar and floating joints
fishbotics
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm sorry for the super slow reply on our part. These changes are super helpful. I did a pretty major refactor of the library to make it more readable (and have proper types) so merging this is going to be difficult. I'm happy to take it on and push the updates if you're ok with it, but it would be super helpful to know why you removed some of the none-checks.
Also, if you have any tests you've been using to verify correctness, we'd appreciate you sharing those!
| elif self.joint_type == "fixed": | ||
| return self.origin | ||
| elif self.joint_type in ["revolute", "continuous"]: | ||
| if cfg is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the motivation for these changes?
| translation[:3, 3] = self.axis * cfg | ||
| return self.origin.dot(translation) | ||
| elif self.joint_type == "planar": | ||
| if cfg is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto--why these changes?
| return self.origin.dot(translation) | ||
| elif self.joint_type == "floating": | ||
| if cfg is None: | ||
| cfg = np.zeros(6, dtype=np.float64) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here
| elif self.joint_type == "fixed": | ||
| return np.tile(self.origin, (n_cfgs, 1, 1)) | ||
| elif self.joint_type in ["revolute", "continuous"]: | ||
| if cfg is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason you're removing the guards against None?
Hello, it seemed like urchin's batched forwards kinematics functions didn't have support for planar and floating joints. I went through updated the relevant functions to add that support. To also simplify the forwards kinematics for those two joint types, I added functionality that would unpack a flat list or numpy array to the corresponding 2dof or 6dof inputs for those joints.
So, if you have a planar joint followed by a revolute joint, you can now do [x_val, y_val, rot_val] as your list input instead of [[x_val, y_val], rot_val], which helps with the numpy batching form for forward kinematics.
I also noticed that there were extra None type checks in
get_child_poseandget_child_poses, so I also went ahead and removed those in one of those commits, but if that's a no-go, I can remove that commit.