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 more occupancy update functions to VoxelGridShape #1083

Merged
merged 9 commits into from
Jul 20, 2018

Conversation

jslee02
Copy link
Member

@jslee02 jslee02 commented Jul 16, 2018

This PR adds more occupancy update functions that can specify reference frame of the sensor origin and the point cloud.


Before creating a pull request

  • Document new methods and classes
  • Format new code files using clang-format

Before merging a pull request

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

@jslee02 jslee02 added this to the DART 6.6.0 milestone Jul 16, 2018
@jslee02 jslee02 requested a review from mxgrey July 16, 2018 04:20
@codecov
Copy link

codecov bot commented Jul 16, 2018

Codecov Report

Merging #1083 into release-6.6 will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff              @@
##           release-6.6    #1083   +/-   ##
============================================
  Coverage        56.52%   56.52%           
============================================
  Files              316      316           
  Lines            24398    24398           
============================================
  Hits             13791    13791           
  Misses           10607    10607

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.

Besides a few nitpicks, this is looking good to me.

{
if (inCoordinatesOf == Frame::World())
{
mOctree->insertPointCloud(pointCloud, toVector3(sensorOrigin));
Copy link
Member

Choose a reason for hiding this comment

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

Just to be clear, will this also clear out the previous occupancy? To me, the function name insertPointCloud implies that it will add these points to the already existing occupancy grid, but the name updateOccupancy implies that we will replace the existing occupancy grid with the new one.

Maybe we could add a comment here to clarify that the existing occupancy will be cleared (or else change the name of updateOccupancy).

Copy link
Member Author

Choose a reason for hiding this comment

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

Just to be clear, will this also clear out the previous occupancy? To me, the function name insertPointCloud implies that it will add these points to the already existing occupancy grid, ...

You're correct. More precisely, the function updates the occupancy probabilities. The probability at the end point will be increased, and the probabilities at the points that the rays pass through will be decreased. I used "update" term in that sense. I just couldn't come up with better name for that. Any suggestions? 😄

Copy link
Member

Choose a reason for hiding this comment

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

I think I follow. Does this function have hysteresis, then? Where the previous state will have an effect on the current state? If so, it might be good to mention that in the documentation of updateOccupancy.

I think the word "update" is reasonable, or at least I don't have a better suggestion off the top of my head. But I think sometimes "update" implies that the previous state will be wiped out, so that might be worth clarifying in documentation somewhere.

Copy link
Member Author

Choose a reason for hiding this comment

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

Does this function have hysteresis, then? Where the previous state will have an effect on the current state? If so, it might be good to mention that in the documentation of updateOccupancy.

Hm, not sure if I understand your question correctly. The probability updates are done by Octomap (e.g., by insertPointCloud). Let me try to update documentation more correctly.

But I think sometimes "update" implies that the previous state will be wiped out, so that might be worth clarifying in documentation somewhere.

I agree. The meaning of "update" term often cases too broad. I might use "set" in the case of wiping out the original value.

#include "dart/dynamics/Shape.hpp"

namespace dart {
namespace dynamics {

class Frame;
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're including the Frame.hpp header, we won't need this forward declaration.

void updateOccupancy(
const octomap::Pointcloud& pointCloud,
const octomap::point3d& sensorOrigin);
const Eigen::Vector3d& sensorOrigin,
const Eigen::Isometry3d& inCoordinatesOf);
Copy link
Member

Choose a reason for hiding this comment

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

I think this parameter should be named relativeTo to match our established terminology. inCoordinatesOf has been used to imply only a rotation of coordinate frame, without accounting for any difference in position.

mxgrey
mxgrey previously approved these changes Jul 19, 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.

I noticed a couple typos in the comments, but otherwise this looks good to me.

/// and the new sensor measurement.
///
/// The voxels of the end points of rays will increase the probability because
/// that's where the ray hit an object. On the other hand, the voxles that the
Copy link
Member

Choose a reason for hiding this comment

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

voxles --> voxels

/// and the new sensor measurement.
///
/// The voxels of the end points of rays will increase the probability because
/// that's where the ray hit an object. On the other hand, the voxles that the
Copy link
Member

Choose a reason for hiding this comment

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

voxles --> voxels

@jslee02 jslee02 changed the title Add more update functions to VoxelGridShape Add more occupancy update functions to VoxelGridShape Jul 19, 2018
@jslee02 jslee02 merged commit 9613b3c into release-6.6 Jul 20, 2018
@jslee02 jslee02 deleted the enhance/voxel_grid_api branch July 20, 2018 02:23
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