Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

Questions tagged [shared-ptr]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2 votes
1 answer
22 views

ROS2 rclcpp subscriber callback uses same shared_ptr for each new message

I have an rclcpp node with some message data coming in (images, scans, etc). I would like to apply temporal filtering to this data, and therefore store a copy of each incoming message. I assumed ...
edgex004's user avatar
1 vote
1 answer
187 views

::SharedPtr vs std::shared_ptr<>

Hello, Please bear with me, I haven´t been programming since 2006, and it turns out that learning both c++11/c++17 and ROS2 has a bit of a steep learning curve. ;-) After reading the relevant chapters ...
JRTG's user avatar
  • 1,974
0 votes
2 answers
48 views

make_unique vs make_shared

Hello, In the TF2 listener tutorial (c++), the buffer is defined as a std::unique_ptr whereas the listener is a std::shared_ptr. ...
JRTG's user avatar
  • 1,974
0 votes
1 answer
12 views

shared pointer vs make shared ros2

What is the difference between make shared and shared pointer? Accompanied by relevant links/information about the two as a basis would help when explaining. When/why would one be chosen over the ...
user avatar
0 votes
1 answer
4 views

Subscriber callback in class defined as shared_ptr

Hi, I have very weird problem. I'm trying to set callback function to one of my subscribers. The problem is that the object, in which the callback function is declared, is defined as ...
user avatar
0 votes
1 answer
5 views

Crash while launching multiple instances of same nodelet

Hello, I am trying to load a nodelet multiple times. But the node is getting crashed once the second instance of the node let started executing. Below snippet describes the way I am loading the ...
user avatar
0 votes
1 answer
56 views

Convert message const ptr to non-const ptr

What is the PROPER way to convert the ConstPtr that I receive in a message callback to a non-const ptr so that I can modify the data? What I want to do is to store a buffer of the messages my node ...
user avatar
0 votes
1 answer
7 views

Copy sensor_msgs::LaserScanPtr& from callback function

I have a local class member that I have defined as follows sensor_msgs::LaserScan *current_scan_ = new sensor_msgs::LaserScan; I also have a callback function which is called when a new laser scan ...
user avatar
0 votes
1 answer
4 views

ConstPtr NULL with waitForMessage

Hello. I have a function which is supposed to just get one message from a topic, the function looks like this: ...
user avatar
0 votes
1 answer
14 views

how to receive non-const shared_ptr without copies when publishing between nodelets?

I have several nodelets sharing a C++ class adapted to ROS message_traits. I'm publishing a non-const shared_ptr to other nodelets. The nodelets expecting a ConstPtr on the callback receive the same ...
user avatar
0 votes
1 answer
4 views

nodelets what to take care of?

I have two classes, image publisher and image processor. Both classes start internal boost::threads for camera and sensor drivers, image processing worker threads. Both classes take long in their ...
user avatar
0 votes
3 answers
3 views

Zero copy passing of OpenCV datatypes with nodelets

Hi, I am thinking about setting up an image processing pipeline using nodelets for a high flexibility. Is there a easy way to pass OpenCV datatypes between nodelets without having to convert them to ...
user avatar
0 votes
1 answer
4 views

PCL-ROS run time error while doing plane segmentation

Hello everyone, I am trying to do plane segmentation using PCL and ROS. I am using the sensor Asus xtion pro live. I was able to launch openni_kinect and got the sensor pumping out necessary ...
user avatar
0 votes
1 answer
3 views

error when I try to read a ros msg composite by another msg file into a node subscriber calback

Error when I try to read a ros msg composite by another msg file into a node subscriber callback. I have this ROS msgs. ...
user avatar
0 votes
1 answer
6 views

Are zero-copy services possible (nodelet + rosservice)?

With nodelets you can have zero-copy message passing via shared pointers. Is there a mechanism to do the same with services? Will data be copied running ros::ServiceClient::call() if both service ...
user avatar
0 votes
2 answers
14 views

Sending the image using cvbridge

I am getting in image from a webcam using cvbridge. What I want to be able to do is change a few things to that image, and finally publish it. When I try to create another cvImagePtr and change the ...
user avatar