Code Monkey home page Code Monkey logo

openni2-tracker's Introduction

openni2_tracker

openni2_tracker is a ROS Wrapper for the OpenNI2 and NiTE2 Skeleton Tracker. This is designed as a companion package to the openni2_camera package (found here). Currently, all this node does is publish TF frames of the current tracked user's joint locations. I will eventually be adding a user message similar to the old openni_tracker ROS package.

** Note: These instructions only been tested with the Primesense Carmine 1.08 tracker. There is a way to get this working with the Kinect, using the freenect drivers, but I have not tested that yet. There is information here on how to use freenect with OpenNI2.

Installation

  1. Clone the beta OpenNI2 repository from Github:

    git clone [email protected]:OpenNI/OpenNI2.git

    Then, switch to the OpenNI2 directory and build:

    cd OpenNI2
    make
  2. Install Nite2 from the OpenNI Website here. Be sure to match the version (x86 or x64) with the version of OpenNI2 you installed above. You will probably need to create a free account.

    Change directories to the NiTE location and install with

    cd NiTE-Linux-x64-2.2
    sudo ./install.sh

    Try and run one of the examples in .../NiTE-Linux-x64-2.2/Samples/Bin/NiTE2. If these don't work, then something went wrong with your installation.

  3. Clone openni2_tracker to your ROS workspace.

    git clone [email protected]:futureneer/openni2-tracker.git
  4. Configure CMake In the CMakeLists.txt file inside the openni2_tracker package, you will need to change the path where CMake will look for OpenNI2 and NiTE2. These two lines:

    set(OPENNI2_DIR ~/dev/OpenNI2)
    set(NITE2_DIR ~/dev/NiTE-Linux-x64-2.2/)

    need to point to the root directories of where you extracted or cloned OpenNI2 and NiTE2.

  5. Make openni2_tracker

    roscd openni2_tracker
    rosmake
  6. Set up NiTE2: Right now, NiTE requires that any executables point to a training sample directory at .../NiTE-Linux-x64-2.2/Samples/Bin/NiTE2. If you run the NiTE sample code, this works fine because those examples are in that same directory. However, to be able to roslaunch or rosrun openni2_tracker from any current directory, I have created a workaround script setup_nite.bash. This script creates a symbolic link of the NiTE2 directory in your .ros directory (the default working directory for roslaunch / rosrun). You will need to modify this file so that it points to YOUR NiTE2 and .ros locations. I would be pleased if anyone has a better solution to this.

  7. Run openni2_tracker

    roslaunch openni2_tracker tracker.launch

    In the lauch file, you can rename both the tracker name and the tracker's relative frame. I have included a static publisher that aligns the tracker frame to the world frame, approximately 1.25m off the floor.

    <!-- openni2_tracker Launch File -->
    <launch>
    
      <arg name="tracker_name" default="tracker" />
      
      <node name="tracker" output="screen" pkg="openni2_tracker" type="tracker" >
        <param name="tf_prefix" value="$(arg tracker_name)" />
        <param name="relative_frame" value="/$(arg tracker_name)_depth_frame" />
      </node>
    
      <!-- TF Static Transforms to World -->
      <node pkg="tf" type="static_transform_publisher" name="world_to_tracker" args=" 0 0 1.25 1.5707 0 1.7707  /world /$(arg tracker_name)_depth_frame 100"/> 
    
    </launch>

    Currently, this node will broadcast TF frames of the joints of any user being tracked by the tracker. The frame names are based on the tracker name, currently /tracker/user_x/joint_name

THANKS!

Please let me know if something doesnt work, or if you have suggestions (or feel free to add stuff and send a pull request).

openni2-tracker's People

Contributors

futureneer avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.