lmc_driver_node.cpp
Go to the documentation of this file.
00001 #include <iostream>
00002 
00003 #include "ros/ros.h"
00004 #include "leap_motion/Human.h"
00005 
00006 #include "../inc/lmc_listener.h"
00007 #include "Leap.h"
00008 
00009 using namespace Leap;
00010 
00011 int main(int argc, char** argv) {
00012 
00013     ros::init(argc, argv, "leap_motion");
00014     ros::NodeHandle nh("leap_motion");
00015 
00016     bool setup_params[7];
00017 
00018     // Read parameters from the defined in listener_params.yaml
00019     nh.getParam("/enable_controller_info", setup_params[0] );
00020     nh.getParam("/enable_frame_info", setup_params[1] );
00021     nh.getParam("/enable_hand_info", setup_params[2] );
00022 
00023     nh.getParam("/enable_gesture_circle", setup_params[3] );
00024     nh.getParam("/enable_gesture_swipe", setup_params[4] );
00025     nh.getParam("/enable_gesture_screen_tap", setup_params[5] );
00026     nh.getParam("/enable_gesture_key_tap", setup_params[6] );
00027 
00028     LeapListener listener(setup_params);
00029     // Add a publisher to the leapListener object
00030     listener.ros_publisher = nh.advertise<leap_motion::Human>("leap_device", 1);
00031 
00032     Controller controller;
00033     controller.addListener(listener);
00034     // Keep doing ROS spin until shutdown() or Ctrl+C
00035     ros::spin();
00036     controller.removeListener(listener);
00037 
00038     return 0;
00039 }


leap_motion
Author(s): Florian Lier , Mirza Shah , Isaac IY Saito
autogenerated on Sat Jun 8 2019 18:47:25