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

Add TranslationalJoint2D #1003

Merged
merged 16 commits into from
Feb 23, 2018
Merged

Add TranslationalJoint2D #1003

merged 16 commits into from
Feb 23, 2018

Conversation

jslee02
Copy link
Member

@jslee02 jslee02 commented Feb 21, 2018

TranslationalJoint2D is a 2d version of TranslationalJoint or PlanarJoint without the rotational axis.


Before creating a pull request

  • Document new methods and classes

Before merging a pull request

  • Set version target by selecting a milestone on the right side
  • Summarize this change in CHANGELOG.md
  • Add unit test(s) for this change (need tests for SkelParser)

@jslee02 jslee02 added this to the DART 6.4.0 milestone Feb 21, 2018
@jslee02 jslee02 requested a review from mxgrey February 21, 2018 21:54
@codecov
Copy link

codecov bot commented Feb 22, 2018

Codecov Report

Merging #1003 into release-6.4 will decrease coverage by 0.19%.
The diff coverage is 30.05%.

@@              Coverage Diff               @@
##           release-6.4    #1003     +/-   ##
==============================================
- Coverage        56.81%   56.62%   -0.2%     
==============================================
  Files              310      314      +4     
  Lines            24117    24298    +181     
==============================================
+ Hits             13703    13758     +55     
- Misses           10414    10540    +126
Impacted Files Coverage Δ
dart/dynamics/TranslationalJoint2D.hpp 100% <100%> (ø)
dart/utils/SkelParser.cpp 67.01% <2.43%> (-2.74%) ⬇️
...art/dynamics/detail/TranslationalJoint2DAspect.cpp 35.41% <35.41%> (ø)
dart/dynamics/TranslationalJoint2D.cpp 37.5% <37.5%> (ø)
...art/dynamics/detail/TranslationalJoint2DAspect.hpp 60% <60%> (ø)

@mxgrey
Copy link
Member

mxgrey commented Feb 22, 2018

I should have some time tonight to give this a review.

Copy link
Member

@mxgrey mxgrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a suggestion regarding TranslationalJoint2dUniqueProperties, but nothing too significant. A few higher level thoughts below:

  1. I wonder if we should consider naming the joint TranslationalJoint2D, since 2d might look awfully similar to Eigen's convention, where the lowercase d refers to double rather than Dimension.

  2. This PR is making me realize just how much silly boilerplate is still required to implement a new joint type correctly. Ideally, we should just be able to define the unique properties, and then define the relative transform behavior and the Jacobian behavior. I think that could be achieved through a policy-based design scheme. But that's far outside the scope of this PR.

struct TranslationalJoint2dUniqueProperties
{
/// Plane type
PlaneType mPlaneType;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we've gone through the trouble of making the member functions, I feel that it would make sense to make these member variables private. That would ensure that this member data always remains sane. I think the mild inconvenience of not being able to set these values directly is heavily outweighed by the importance of keeping the values sane and consistent.

struct TranslationalJoint2dUniqueProperties
{
/// Plane type
PlaneType mPlaneType;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we've gone through the trouble of making all the member function, I feel like it would make sense to have these member variables be private. That way, we can rely on the member functions to keep the values sane and consistent. I think the inconvenience of not having direct access to the members is heavily outweighed by the value of guaranteeing sanity and consistency.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, apparently if you leave a review comment, accidentally close the webpage, and come back to continue reviewing, Github will (sometimes) pretend that you didn't leave the review comment at all....


if (type == "xy")
{
properties.mPlaneType = dynamics::PlanarJoint::PlaneType::XY;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we do make the member variables private, we'll need to tweak the implementation of this parser to store these parameters and then pass them into the member functions of properties.

@jslee02
Copy link
Member Author

jslee02 commented Feb 23, 2018

This PR is making me realize just how much silly boilerplate is still required to implement a new joint type correctly. Ideally, we should just be able to define the unique properties, and then define the relative transform behavior and the Jacobian behavior.

Agreed. This is one of the reasons GenericJoint was introduced with the configuration space classes (e.g., RealVectorSpace and SO3Space). I intended to generalize the joint behavior using GenericJoint and define the concrete behaviors (e.g., Jacobian computations specific to the concrete configuration types) using geometric computations that are also templatized to the configuration spaces (e.g., integratePosition() in math/ConfigurationSpace.hpp) so that we only require minimum effort to add new joint types of new configuration spaces and furthermore any compositions of the current joint spaces. Since there are more rooms to improve the current implementation, we might want to revisit this at some point.

@jslee02 jslee02 changed the title Add TranslationalJoint2d Add TranslationalJoint2D Feb 23, 2018
Copy link
Member

@mxgrey mxgrey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like a member variable of TranslationalJoint2DUniqueProperties was left behind.

struct TranslationalJoint2DUniqueProperties
{
/// First and second translational axis
Eigen::Matrix<double, 3, 2> mTransAxes;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would also want this member variable to be private.

I would also suggest changing this from a struct to a class since it's no longer a POD.

@jslee02 jslee02 merged commit d8802f4 into release-6.4 Feb 23, 2018
@jslee02 jslee02 deleted the enhancement/trans_joint_2d branch February 23, 2018 22:55
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