Skip to content

Conversation

@BuildingAtom
Copy link

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_pose and get_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.

Copy link
Owner

@fishbotics fishbotics left a 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:
Copy link
Owner

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:
Copy link
Owner

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)
Copy link
Owner

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:
Copy link
Owner

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants