ROS wrapper of libsurvive for getting position from HTC Vive Tracker.
Positioning Test (YouTube video)
Offboard Flight Test (YouTube video)
Download image for Raspberry Pi (required version 0.17)
Install dependencies needed for libsurvive:
sudo apt-get install liblapacke-dev libopenblas-dev libatlas-base-dev libusb-1.0-0-dev libpcap-dev
Clone this git repository to separate catkin workspace:
mkdir -p ros_catkin_ws/src
cd ~/ros_catkin_ws/src
git clone https://github.com/sfalexrog/roslibsurvive.git
Init libsurvive submodule:
cd roslibsurvive
git submodule update --init
Copy udev rules:
cp vendor/libsurvive/useful_files/81-vive.rules /etc/udev/rules.d/
Build ROS packages (on memory constrained platforms you might be going to need to use -j1
key):
cd ~/ros_catkin_ws
catkin_make -j1
Enable systemd service roscore
(if not running):
sudo systemctl enable /home/pi/catkin_ws/src/clever/deploy/roscore.service
sudo systemctl start roscore
Calibrate the system. Put calibration file (config.json) from our repo (with necessary settings but without calibration data) to ~/.ros/ directory and start node. Stop node after the end of calibration process. You should recalibrate the system if the position of one of the lighthouses changes.
cp ~/ros_catkin_ws/src/roslibsurvive/config.json ~/.ros
roslaunch roslibsurvive simple.launch
Start the node for autonomous drone control. It will publish HTC Vive Tracker pose to /mavros/vision_pose/pose and run simple_offboard service from clever package to controll the drone autonomously:
roslaunch roslibsurvive direct.launch
Main parameters for the roslibsurvive_frame_publisher are:
- vive_base_frame_id - pose and frame header id;
- static_yaw, static_pitch, static_roll - rotation of Vive Tracker relative to flight controller board.
The result pose and frame are published as "~T20_pose_t1" and "T20_t1" respectively.
You can use vive_tracker.rviz file as settings for rviz to watch that you setup the correct position of tracker.