Skip to content
This repository has been archived by the owner on Nov 13, 2017. It is now read-only.

improved computation of interactive marker size #613

Merged
merged 3 commits into from
Nov 25, 2015
Merged

improved computation of interactive marker size #613

merged 3 commits into from
Nov 25, 2015

Conversation

rhaschke
Copy link
Contributor

  • use parent_link if group == parent_group (instead of default)
  • scale smaller than 5cm is clipped to 5cm (instead of falling back to default)
    If there is a really small end-effector group / link, we should rely on the computation too, shouldn't we?
  • clarified size computation, using diameter of AABB

double s = 1.01 * ext.norm();

// clip scale to 5cm
return std::max(0.05, s);
Copy link
Member

Choose a reason for hiding this comment

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

how did you choose 5cm here? i've seen some robots whose model does not properly follow metric sizing, i.e. they could be a couple of orders of magnitude larger or smaller than real life meters. Seems this could be error prone hard coding 0.05

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would agree, that the code should simply rely on its measurements, regardless of magnitude.
However, I didn't invent the 5cm limit. It was there before (see below) and I didn't want to break existing code.
Probably it was there for some reason.

Copy link
Member

Choose a reason for hiding this comment

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

ah indeed! seems like that should have at least be a static const

@rhaschke
Copy link
Contributor Author

added the proposed static const variable
modified the comment as suggested

@davetcoleman
Copy link
Member

This makes sense to me, but I am not able to test it (away from office) so am hesitant to merge. Not sure how to verify this won't cause unexpected visual change for others.

@rhaschke
Copy link
Contributor Author

There is no need to hurry. I'm at IROS conference this week too. Of course, this PR will have some visual effects.
For us, having a Shadow robot hand with five rather small fingertips, it was kind of necessary to have both, a large end-effector marker at the palm (to pull the arm) and smaller end-effectors for the fingertips. With the old code, the marker size fall back to a rather large default size not suitable for fingers. However, the size setting in the rviz gui is global a resize also the palm marker that needs to be larger...

@sachinchitta
Copy link
Contributor

I just tried this - the markers are much smaller than they used to be. You can try it with the same robot - https://github.com/sachinchitta/moveit_examples

- use parent_link if group == parent_group
- scale smaller than 5cm is clipped to 5cm instead of using default
- clarified size computation, using diameter of AABB
compute size such that the marker sphere will cover
- a spherical link geometry -> AABB.maxCoeff
- a cubical link geometry -> AABB.norm
-> use average of both values

Virtual links (without any shape) will have a size of AABB of zero dims.
In this case use the dimensions of the closest parent link instead.
@rhaschke
Copy link
Contributor Author

@sachinchitta Indeed your example robot has a virtual end-effector link (resulting in size zero), which I didn't considered during implementation yet. To handle this case gracefully (instead of returning the DEFAULT_SIZE), I now use the size of the closest non-virtual parent link.
This will give a reasonable marker size in that case too.

@sachinchitta
Copy link
Contributor

This looks better now but would be good to have the size still be a little bigger - I tried it with 3.0 * size and it was easier to interact with.

- drop largest extension dimension (-> use cross-section size of elongated link)
- for an end-effector group, consider the sizes of individual links
  instead of the overall size of all links (which becomes huge very fast)
- enlarge marker size by factor of 1.5 when there is only a single eef marker
@sachinchitta
Copy link
Contributor

LGTM.

sachinchitta added a commit that referenced this pull request Nov 25, 2015
improved computation of interactive marker size
@sachinchitta sachinchitta merged commit 74afed7 into moveit:indigo-devel Nov 25, 2015
@rhaschke rhaschke deleted the F-marker-size branch November 26, 2015 09:55
otamachan pushed a commit to otamachan/moveit_ros that referenced this pull request Oct 22, 2017
otamachan pushed a commit to otamachan/moveit_ros that referenced this pull request Oct 22, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants