Functions | Variables
lmc_visualizer_node.cpp File Reference
#include "ros/ros.h"
#include "visualization_msgs/Marker.h"
#include "visualization_msgs/MarkerArray.h"
#include "leap_motion/Human.h"
#include "leap_motion/Hand.h"
#include "leap_motion/Finger.h"
#include "leap_motion/Bone.h"
#include "Leap.h"
#include <iostream>
Include dependency graph for lmc_visualizer_node.cpp:

Go to the source code of this file.

Functions

visualization_msgs::Marker createFingerLines (const leap_motion::Human::ConstPtr &human, std::string hand_ns, std::string finger_ns, unsigned int id, leap_motion::Bone current_bone)
 Adds lines between the tips of the bones. More...
 
visualization_msgs::Marker createHandOutline (const leap_motion::Human::ConstPtr &human, std::string hand_ns, unsigned int id, leap_motion::Hand current_hand)
 Creates a representation of palm. More...
 
visualization_msgs::Marker createJointMarker (const leap_motion::Human::ConstPtr &human, std::string hand_ns, std::string finger_ns, unsigned int id, geometry_msgs::Pose location)
 Adds circles at the intersection of bones. More...
 
visualization_msgs::Marker createPalmPosition (const leap_motion::Human::ConstPtr &human, std::string hand_ns, unsigned int id, geometry_msgs::Point centre_point)
 Represents the midpoint of the palm. More...
 
void createVisualization (visualization_msgs::MarkerArray *marker_array, const leap_motion::Human::ConstPtr &human, leap_motion::Hand hand, std::string hand_ns, uint8_t hand_id)
 Creates a visualization of an entire hand from he wrist up. More...
 
void frameCallback (const leap_motion::Human::ConstPtr &human)
 Called when a new Human.msg is received. More...
 
int main (int argc, char **argv)
 

Variables

const std::string fingerNames [] = {"Thumb", "Index", "Middle", "Ring", "Pinky"}
 
static ros::Publishermarker_pub
 

Function Documentation

visualization_msgs::Marker createFingerLines ( const leap_motion::Human::ConstPtr &  human,
std::string  hand_ns,
std::string  finger_ns,
unsigned int  id,
leap_motion::Bone  current_bone 
)

Adds lines between the tips of the bones.

Takes a pointer to human.msg, and a bone.msg. Using that information adds lines between the tips of the bones.

Parameters
humanPointer to the received Human.msg
hand_nsUsed to create a unique namespace
finger_nsUsed to create a unique namespace
current_boneThe bone that will be represented as a line.

Definition at line 68 of file lmc_visualizer_node.cpp.

visualization_msgs::Marker createHandOutline ( const leap_motion::Human::ConstPtr &  human,
std::string  hand_ns,
unsigned int  id,
leap_motion::Hand  current_hand 
)

Creates a representation of palm.

Takes a pointer to human.msg, and a hand.msg. Using that information adds draw lines between fingers to create a palm.

Parameters
humanPointer to the received Human.msg
hand_nsUsed to create a unique namespace
finger_nsUsed to create a unique namespace
current_handThe hand from which the palm will be created

Definition at line 113 of file lmc_visualizer_node.cpp.

visualization_msgs::Marker createJointMarker ( const leap_motion::Human::ConstPtr &  human,
std::string  hand_ns,
std::string  finger_ns,
unsigned int  id,
geometry_msgs::Pose  location 
)

Adds circles at the intersection of bones.

Takes a pointer to human.msg, and a start of a bone. Using that information creates a sphere visualization marker that will later be appended to a marker array.

Parameters
humanPointer to the received Human.msg
hand_nsUsed to create a unique namespace
finger_nsUsed to create a unique namespace
locationTip position of a bone object

Definition at line 27 of file lmc_visualizer_node.cpp.

visualization_msgs::Marker createPalmPosition ( const leap_motion::Human::ConstPtr &  human,
std::string  hand_ns,
unsigned int  id,
geometry_msgs::Point  centre_point 
)

Represents the midpoint of the palm.

Takes a pointer to human.msg, and pose the the centre point of the palm. Using that information creates a sphere at that location.

Parameters
humanPointer to a received Human.msg
hand_nsUsed to create a unique namespace
idA unique id to the created marker
centre_pointThe palm centre of a hand

Definition at line 225 of file lmc_visualizer_node.cpp.

void createVisualization ( visualization_msgs::MarkerArray *  marker_array,
const leap_motion::Human::ConstPtr &  human,
leap_motion::Hand  hand,
std::string  hand_ns,
uint8_t  hand_id 
)

Creates a visualization of an entire hand from he wrist up.

Using the given information calls out different functions to create a visualization of a detected hand for displaying in Rviz.

Parameters
marker_arrayAn array into which all created markers will be added
humanPointer to a received Human.msg
handA hand.msg from which the hand visualization will be created.
hand_nsUsed to create a unique namespace
hand_idA unique id to the create markers

Definition at line 268 of file lmc_visualizer_node.cpp.

void frameCallback ( const leap_motion::Human::ConstPtr &  human)

Called when a new Human.msg is received.

Parameters
humanPointer to thr received Human.msg

Definition at line 310 of file lmc_visualizer_node.cpp.

int main ( int  argc,
char **  argv 
)

Definition at line 330 of file lmc_visualizer_node.cpp.

Variable Documentation

const std::string fingerNames[] = {"Thumb", "Index", "Middle", "Ring", "Pinky"}

Definition at line 14 of file lmc_visualizer_node.cpp.

ros::Publisher* marker_pub
static

Definition at line 13 of file lmc_visualizer_node.cpp.



leap_motion
Author(s): Florian Lier , Mirza Shah , Isaac IY Saito
autogenerated on Tue Jun 2 2020 03:58:01