-
Notifications
You must be signed in to change notification settings - Fork 330
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
Corrected publish calls with shared_ptr signature #327
Conversation
In many cases same comment as here: ros2/rclcpp#709 (comment) |
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.
I started commenting on each, but I think most, if not all, can be converted to use a reference rather than a pointer (unique or shared).
Can you please look at each case and try to convert to a reference, and failing that convert to a unique_ptr
, and failing that leave it as a shared_ptr
. I'll have a look at the cases for the latter two results, because I expect them to be limited, and the shared_ptr
to be unnecessary in all cases.
Actually, should we prefer Thoughts? |
04ff47f
to
ced1a6a
Compare
Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>
Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>
Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>
Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>
Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>
Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>
e14b1d8
to
94f88aa
Compare
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.
I'm not familiar enough with the intra-process changes to comment on whether stack variables vs unique_ptr should be used. The changes that are here seem reasonable
size_t i = 1; | ||
|
||
// Our main event loop will spin until the user presses CTRL-C to exit. | ||
while (rclcpp::ok()) { | ||
// Initialize a shared pointer to an Image message. |
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.
nit, shared
-> unique
Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com>
* Corrected publish calls with shared_ptr signature Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com> * Corrected with PR comments Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com> * Changed unique_ptr publish calls Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com> * Corrected publish call with unique_ptr in logger_usage_component Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com> * Solve linter problems. Corrected pendulum_control demo. Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com> * Cleaned allocator_tutorial Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com> * Corrected talker_serialized_message.cpp Signed-off-by: ivanpauno <ivanpauno@ekumenlabs.com> Signed-off-by: Darby Lim <thlim@robotis.com>
Connects to ros2/rclcpp#709