Skip to content

minor fixes - #45

Merged
davetcoleman merged 2 commits into
moveit:indigo-develfrom
v4hn:indigo-minor-cleanup
Aug 16, 2016
Merged

davetcoleman merged 2 commits into
moveit:indigo-develfrom
v4hn:indigo-minor-cleanup

Conversation

@v4hn

@v4hn v4hn commented Aug 15, 2016

Copy link
Copy Markdown
Contributor

These changes clean up some problems with handling an empty robot model.

v4hn added 2 commits August 15, 2016 15:38
otherwise it is not set later on in case no root link is available
…ut description

This printed a warning because "_" is no valid initial letter for a ros parameter.
@v4hn

v4hn commented Aug 15, 2016 via email

Copy link
Copy Markdown
Contributor Author

root_joint_ = NULL;
root_link_ = NULL;
link_geometry_count_ = 0;
variable_count_ = 0;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think this belongs here - it gets set to 0 later in subfunction buildJointInfo() when it is used

This should go in the constructor or (my fav) in the member variable declaration in C++11

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

On Mon, Aug 15, 2016 at 12:38:11PM -0700, Dave Coleman wrote:

I don't think this belongs here - it gets set to 0 later in subfunction buildJointInfo() when it is used

No it does not. It is computed there (it is incremented for each joint later in that routine).
But importantly, this only happens if there is a root joint.

This should go in the constructor or (my fav) in the member variable declaration in C++11

You're welcome to refactor the RobotModel class.
As of now (and especially in indigo) I would prefer to keep this default initialization together with similar initializations.
That's where I put it, to fix the missing initialization when no root link is present.

Everything else would be a separate request imho.

Also, I'm not sure yet what to make out of C++11's member variable initialization.
To me, it feels better to have the initialization values of member variables with the implementation of the constructor and not with the definition of the class.
Internally, this seems to be what is happening even with the C++11 feature - this can have weird consequences.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

But importantly, this only happens if there is a root joint.

Ah, I missed that

@davetcoleman
davetcoleman merged commit 36ae514 into moveit:indigo-devel Aug 16, 2016
@davetcoleman

Copy link
Copy Markdown
Member

Side note: I'd prefer better PR titles such as "Empty Robot Model Fixes"

@davetcoleman

Copy link
Copy Markdown
Member

cherry-picked to J/K

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