création filtre passe-tout

This commit is contained in:
Louis-Guillaume DUBOIS 2015-04-22 16:53:52 +02:00
parent 891c6471ac
commit a78ad6ab5a
2 changed files with 17 additions and 16 deletions

View file

@ -108,7 +108,9 @@ include_directories(
# ) # )
## Declare a cpp executable ## Declare a cpp executable
# add_executable(hand_control_node src/hand_control_node.cpp) add_executable(filtre src/filtre.cpp)
target_link_libraries(filtre ${catkin_LIBRARIES})
add_dependencies(filtre ${catkin_EXPORTED_TARGETS})
## Add cmake target dependencies of the executable/library ## Add cmake target dependencies of the executable/library
## as an example, message headers may need to be generated before nodes ## as an example, message headers may need to be generated before nodes

View file

@ -2,27 +2,26 @@
#include <pcl_ros/point_cloud.h> #include <pcl_ros/point_cloud.h>
#include <pcl/point_types.h> #include <pcl/point_types.h>
typedef pcl::PointCloud<pcl::PointXYZRGB> PointCloud; typedef pcl::PointCloud<pcl::PointXYZ> PointCloud;
class Callback class Callback {
{
public: public:
operator()(const PointCloud::Ptr& msg) void operator()(const PointCloud::ConstPtr& msg)
{ {
pub.publish(*msg); // copie du nuage de point
} PointCloud pcl = *msg;
// TODO : ôter les mauvais points
publisher.publish(pcl);
}
Callback(ros::NodeHandle& node) Callback(ros::NodeHandle& node)
{ {
pub = node.advertise<PointCloud>("output", 1); publisher = node.advertise<PointCloud>("output", 1);
} }
private: private:
ros::Publisher pub; ros::Publisher publisher;
}; };
int int main(int argc, char** argv)
main(int argc, char **argv)
{ {
ros::init(argc, argv, "filtre"); ros::init(argc, argv, "filtre");
ros::NodeHandle node; ros::NodeHandle node;