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

clean up and integrate pose estimators #336

Merged
merged 11 commits into from
Apr 28, 2018

Conversation

yskim041
Copy link
Member

@yskim041 yskim041 commented Feb 16, 2018

In this PR, I integrated pose estimator modules for AprilTags and RcnnPose into one PoseEstimator module. I updated ObjectDatabase and corresponding YAML files in pr-ordata (personalrobotics/pr_assets#32) as well.


Before creating a pull request

  • Document new methods and classes
  • Format code with make format

Before merging a pull request

  • Set version target by selecting a milestone on the right side
  • Summarize this change in CHANGELOG.md

@yskim041 yskim041 self-assigned this Feb 16, 2018
@yskim041 yskim041 added this to the Aikido 0.3.0 milestone Feb 16, 2018
@yskim041 yskim041 requested review from brianhou and jslee02 February 16, 2018 22:52
@codecov
Copy link

codecov bot commented Feb 16, 2018

Codecov Report

Merging #336 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #336   +/-   ##
=======================================
  Coverage   81.14%   81.14%           
=======================================
  Files         200      200           
  Lines        5687     5687           
=======================================
  Hits         4615     4615           
  Misses       1072     1072

@@ -44,7 +44,8 @@ class ObjectDatabase
void getObjectByKey(
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we document this method? I'm not entirely clear what obj_offset is.

Copy link
Member Author

Choose a reason for hiding this comment

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

I added the documentation for this. objectName, objectResource, and objectOffset are what should be retrieved from ObjectDatabase. For each key, those values are stored in tag_data_xx.json in pr_ordata.

Copy link
Member Author

@yskim041 yskim041 Apr 21, 2018

Choose a reason for hiding this comment

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

objectOffset is the offset between an AprilTag and the actual origin of an object.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be an offset or a transform? Since it's an Isometry3d it seems like it should be the latter?

Copy link
Member Author

@yskim041 yskim041 Apr 25, 2018

Choose a reason for hiding this comment

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

It is a transformation matrix for the offset. I think Isometry3d is just a way to express it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Some of them in the apriltag tag_data (https://github.com/personalrobotics/pr_ordata/blob/master/data/objects/tag_data_apriltags.json) have rotation components as well.

@jslee02
Copy link
Member

jslee02 commented Feb 18, 2018

This PR looks like removing AprilTags and adding offset to RcnnPose (and changing the name). Having offset was the only difference of AprilTags from RcnnPose? 🤔

@brianhou
Copy link
Contributor

Let's try to update this PR and merge this soon!

@yskim041
Copy link
Member Author

Tested with the can detector by using personalrobotics/herb3_demos#13, and this works well. Since personalrobotics/pr_assets#32 is merged, this branch works with the master branch of pr_ordata.

@@ -41,10 +47,17 @@ class ObjectDatabase

virtual ~ObjectDatabase() = default;

/// Get the object name, resource, and offset from database by objectKey
/// \param[in] objectKey: The key(string) of an object in ObjectDatabase
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe we don't want colons in Doxygen comments. Also, minor typo: key(string) -> key (string).

/// \param[out] objectName: The retrieved object name from ObjectDatabase
/// \param[out] objectResource: The retrieved uri of the object
/// \param[out] objectOffset: The retrieved offset matrix of the object
/// e.g. the offset between a tag and the actual origin of an object
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be i.e. rather than e.g.. Also, I think we should be calling this a transform rather than an offset, if we're using Isometry3d.

/// \c dart::common::Uri, and updates the environment which is an
/// \c aikido::planner::World.
class RcnnPoseModule : public PerceptionModule
class PoseEstimatorModule : public PerceptionModule
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about renaming this to RosPoseEstimationModule?

Copy link
Member Author

Choose a reason for hiding this comment

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

If we want to rename it with a more ros related name, I think RosMarkerArrayClient would be the most clear option. If not, I personally prefer PoseEstimatorModule.

@brianhou
Copy link
Contributor

Looks good! I had a few minor nits, but I think this should be otherwise good to go.

Copy link
Member

@jslee02 jslee02 left a comment

Choose a reason for hiding this comment

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

Looks good to me as well.

I have a nitpick on the local variable names. Our convention is to use Pascal case, but many of local variables names are not following it. Could you either fix them in this PR or create an issue?

@@ -1,4 +1,4 @@
#include <aikido/perception/RcnnPoseModule.hpp>
#include <aikido/perception/PoseEstimatorModule.hpp>
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Our convention is to use "..." for AIKIDO headers instead of <...>.

@@ -45,14 +47,14 @@ bool RcnnPoseModule::detectObjects(
// Making sure the Message from RcnnPose is non empty
if (marker_message == nullptr)
{
dtwarn << "[RcnnPoseModule::detectObjects] nullptr Marker Message "
dtwarn << "[PoseEstimatorModule::detectObjects] nullptr Marker Message "
<< mMarkerTopic << std::endl;
return false;
}

if (marker_message->markers.size() == 0)
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Using empty() is more preferred way to check its emptiness rather than size().

@yskim041
Copy link
Member Author

yskim041 commented Apr 23, 2018

The last commit addressed all the issues above.

@brianhou brianhou merged commit 4a63536 into master Apr 28, 2018
@brianhou brianhou deleted the enhancement/yskim041/pose_estimator branch April 28, 2018 00:51
gilwoolee pushed a commit that referenced this pull request Jan 21, 2019
* clean up and integrate pose estimators

* format PoseEstimatorModule

* update CHANGELOG.md

* add documentation

* add documentation

* fix the issues on comments in PR#336
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.

3 participants