Publish sensor data to cartographer
Hey, I'm working with google cartographer and I have a rgb camera. I have a topic where the PointCloud2 data is published to. It's /ifm3d/camera/cloud and I made my own node to publish this data to the cartographer. The cartographer has a topic where points2 is subscribing to. But my problem is that I don't know how to write the code to publish the sensor data to the cartographer. This is my code:
...
ros::init(argc,argv,"point_cloud_publisher);
ros::NodeHandle nh;
ros::Publisher pub_pointCloud = nh.advertise<sensor_msgs::PointCloud>("/points2",1000);
sensor_msgs::PointCloud2 cloud;
So I have a camera and its publishing its data to the topic and I don''t know how to publish it to the cartographer.
If all you want is for Cartographer to be able to "read" the
/ifm3d/camera/cloud
topic then a remap might be more efficient. No need to republish a message just to connect two nodes together.I thought the remap has the function to change the name of the topic
That is sort-of what it does yes.
If you don't need to do any processing on the
/ifm3d/camera/cloud
messages, but just want to forward them, I would advise to use a remap.And how exactly do I have to do this? I have the subscriber points2. In which file?
First: please clarify: do you or do you not need to run your own algorithm on the cloud msgs coming in on
/ifm3d/camera/cloud
?No I just want to forward them and don't need my own algorithm
And do I have to forward it to a publisher?
Ok. In that case you should be able to use a remap.
You could do this either by making the
ifm3d
launch file remap to the topic that Cartographer expects (points2
), or the other way around.