squelette normal_estimator
This commit is contained in:
parent
39273e79ab
commit
4584fb6374
1 changed files with 28 additions and 0 deletions
28
hand_control/src/normal_estimator.cpp
Normal file
28
hand_control/src/normal_estimator.cpp
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
#include <ros/ros.h>
|
||||||
|
#include <pcl_ros/point_cloud.h>
|
||||||
|
#include <pcl/point_types.h>
|
||||||
|
#include <pcl/features/normal_3d.h>
|
||||||
|
#include <geometry_msgs/Quaternion.h>
|
||||||
|
|
||||||
|
typedef pcl::PointXYZRGB Point;
|
||||||
|
typedef pcl::PointCloud<Point> PointCloud;
|
||||||
|
typedef Eigen::Vector4f PCLCoord; // vecteur, accès par v(0), v(1)...
|
||||||
|
typedef geometry_msgs::Quaternion ROSCoord; // struct : x, y, z, w
|
||||||
|
|
||||||
|
int
|
||||||
|
main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
ros::init(argc, argv, "normal_estimator");
|
||||||
|
ros::NodeHandle node("estimator");
|
||||||
|
|
||||||
|
// initialisation
|
||||||
|
ros::Publisher publisher = node.advertise<ROSCoord>("output", 1);
|
||||||
|
Callback callback(publisher);
|
||||||
|
ros::Subscriber subscriber = node.subscribe<PointCloud>("input", 1, callback);
|
||||||
|
|
||||||
|
// démarrage
|
||||||
|
ROS_INFO("node started");
|
||||||
|
ros::spin();
|
||||||
|
ROS_INFO("exit");
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in a new issue