Skip to content

Commit b48e453

Browse files
authored
fix demo codes pod_loaded_msg by sample codes (#44)
https://github.com/ros2/demos/blob/master/demo_nodes_cpp/src/topics/talker_loaned_message.cpp Signed-off-by: zongbao feng <mickeyouou@gmail.com>
1 parent 6848fe6 commit b48e453

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ For a fully working implementation, please have a look at [this demo node](https
9393
```c++
9494
auto pub = node->create_publisher<std_msgs::msg::String>("/chatter", 1);
9595
// Ask the publisher to loan a String message
96-
auto loaned_msg = pub_->borrow_loaned_message();
96+
auto pod_loaned_msg = pub_->borrow_loaned_message();
9797
pod_loaned_msg.get().data = "Hello World";
9898
// Return ownership of that string message
9999
pod_pub_->publish(std::move(pod_loaned_msg));
@@ -114,7 +114,7 @@ Thus, in order to make our demo work with zero copy, we can alternatively send a
114114
```c++
115115
auto pub = node->create_publisher<std_msgs::msg::Float64>("/float", 1);
116116
// Ask the publisher to loan a Float64 message
117-
auto loaned_msg = pub_->borrow_loaned_message();
117+
auto pod_loaned_msg = pub_->borrow_loaned_message();
118118
pod_loaned_msg.get().data = 123.456f;
119119
// Return ownership of that Float64 message
120120
pod_pub_->publish(std::move(pod_loaned_msg));

0 commit comments

Comments
 (0)