Repository navigation
minor fixes - #45
minor fixes#45
Conversation
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.
|
I found these while debugging #43 .
They **do not** resolve the problem, but improve the overall situation.
I see no reason not to apply them even if we take a different route to handling
empty models.
|
| root_joint_ = NULL; | ||
| root_link_ = NULL; | ||
| link_geometry_count_ = 0; | ||
| variable_count_ = 0; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
But importantly, this only happens if there is a root joint.
Ah, I missed that
|
Side note: I'd prefer better PR titles such as "Empty Robot Model Fixes" |
|
cherry-picked to J/K |
These changes clean up some problems with handling an empty robot model.