Skip to content
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

Migrate convert_pointcloud_to_image to ROS 2 #372

Open
wants to merge 5 commits into
base: foxy-devel
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Proper format code
  • Loading branch information
FelipeGdM committed Jun 24, 2022
commit 4c6348682c812af872b334b582190c3049694d04
10 changes: 7 additions & 3 deletions pcl_ros/tools/convert_pointcloud_to_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@
#include <pcl_conversions/pcl_conversions.h>
// stl stuff
#include <string>
// to use make_shared<>
#include <memory>

class PointCloudToImage : public rclcpp::Node
{
Expand All @@ -72,7 +74,7 @@ class PointCloudToImage : public rclcpp::Node
);
}
}
PointCloudToImage(const std::string name)
explicit PointCloudToImage(const std::string name)
: Node(name), cloud_topic_("input"), image_topic_("output")
{
this->sub_ = this->create_subscription<sensor_msgs::msg::PointCloud2>(
Expand Down Expand Up @@ -103,7 +105,9 @@ class PointCloudToImage : public rclcpp::Node
int
main(int argc, char ** argv)
{
rclcpp::init(argc, argv); // this loads up the node
rclcpp::spin(std::make_shared<PointCloudToImage>("convert_pointcloud_to_image")); // where she stops nobody knows
rclcpp::init(argc, argv); // this loads up the node
rclcpp::spin(
std::make_shared<PointCloudToImage>("convert_pointcloud_to_image")
); // where she stops nobody knows
return 0;
}