-
Notifications
You must be signed in to change notification settings - Fork 9
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
Feature: End-Effector Workspace Pose and Velocity (Linear and Angular) Factor #24
base: master
Are you sure you want to change the base?
Conversation
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.
Some high level comments. Will do a full review after these are addressed.
if (H1) { | ||
// Jacobian for the joint positions | ||
*H1 = (Matrix(12, arm_.dof()) << H_ep * J_jpx_jp[arm_.dof() - 1],// | ||
- J_jvx_jp[arm_.dof() - 1]).finished(); |
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.
Some weird formatting issue is happening here. Can you please reformat the file?
std::cout << s << "WorkspacePoseVelocityPrior :" << std::endl; | ||
Base::print("", keyFormatter); | ||
std::cout << "desired end-effector pose : "; | ||
des_pose_.print(); // << std::endl; |
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.
Kill the comment if the std::endl is not being used.
template <class ARCHIVE> | ||
void serialize(ARCHIVE& ar, const unsigned int version) { | ||
ar& boost::serialization::make_nvp( | ||
"NoiseModelFactor1", boost::serialization::base_object<Base>(*this)); |
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 think this should NoiseModelFactor2 and not NoiseModelFactor1
WorkspacePoseVelocityPrior() {} | ||
|
||
/** | ||
* Constructor |
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.
Please add documentation for all parameters.
gtsam::DefaultKeyFormatter) const { | ||
std::cout << s << "WorkspacePoseVelocityPrior :" << std::endl; | ||
Base::print("", keyFormatter); | ||
std::cout << "desired end-effector pose : "; |
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.
Nitpick: capitalize the first letter so the output looks prettier?
Similarly for the below output of the end effector velocity.
Vector6 des_vel = (Vector6() << 0, 0, 0, 0, 0, 0).finished(); | ||
WorkspacePoseVelocityPrior factor(0, 0, cost_model, arm, des_pose, des_vel); | ||
actual = factor.evaluateError(q, qdot, &H_pose_act, &H_vel_act); | ||
expect = (Vector(12) << 00.613943126, 1.48218982, -0.613943126, 1.1609828, |
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.
Can you please comment where you got these numbers from? And please mark this as a regression test.
0.706727485, -0.547039678, 0, -0.141421356237309, 0, | ||
-0.070710678118655, 0.070710678118655, -0.1000) | ||
.finished(); | ||
H_pose_exp = numericalDerivative11( |
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.
Why not use numericalDerivative21
and numericalDerivative22
? It computes the numerical derivative of a binary function wrt the first and second argument respectively.
qdot, 1e-6); | ||
EXPECT(assert_equal(expect, actual, 1e-6)); | ||
EXPECT(assert_equal(H_pose_exp, H_pose_act, 1e-6)); | ||
EXPECT(assert_equal(H_vel_exp, H_vel_act, 1e-6)); |
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.
Assertions should follow immediately after the computation so that the code can fail early without doing extra computation. In this case, the first assert_equal should be right after the expect
variable definition.
Purpose
This factor enables users to specify a desired SE(3) pose and the corresponding linear and angular velocity to the end-effector of a manipulator.
Add Features