-
Notifications
You must be signed in to change notification settings - Fork 408
Use lifecycle node as base for controllers #244
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
Changes from all commits
2299a33
484ad0f
e198942
1d7fdd6
88eed0e
f3abd73
3348ea0
12d5ede
4b2eb0c
b6c22b1
9af7dca
7174ac6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,7 +92,7 @@ struct SegmentTolerances | |
* \return Trajectory segment tolerances. | ||
*/ | ||
SegmentTolerances get_segment_tolerances( | ||
const rclcpp::Node & node, const std::vector<std::string> & joint_names) | ||
const rclcpp_lifecycle::LifecycleNode & node, const std::vector<std::string> & joint_names) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should probably here use SharedPtr to the node and not the object itself. This is usually done in the rest of the code-base. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would disagree. If the function itself doesn't care about the lifetime of the object, then passing by reference should be preferred. Passing a shared pointer has performance costs in incrementing/decrementing the reference count. See https://herbsutter.com/2013/06/05/gotw-91-solution-smart-pointer-parameters for discussion on this topic. |
||
{ | ||
const auto n_joints = joint_names.size(); | ||
SegmentTolerances tolerances; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could have used rclcpp_lifecycle::LifecycleNode::SharedPtr(pretty sure this is defined) as with rclcpp::Node but there is no difference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be better to pass a reference instead of shard_ptr here too?