moon-wreckers / vive_tracker

HTC Vive Tracker Node for ROS
54 stars 28 forks source link

python version error? #7

Open JiyooonPark opened 3 years ago

JiyooonPark commented 3 years ago

Hello, I am trying to use this repository to use vive tracker with ROS and keep on getting errors. I am using ubuntu 18.04 with ROS melodic. As you know ros melodic uses python 2.7 and thus keep on giving me this error when I

roslaunch vive_tracker vive_tracker.launch

File "/home/glab/catkin_ws/src/vive_tracker/scripts/vive_tracker.py", line 6, in <module> import triad_openvr File "/home/glab/catkin_ws/src/vive_tracker/scripts/triad_openvr.py", line 3, in <module> import openvr File "/usr/local/lib/python2.7/dist-packages/openvr/__init__.py", line 2923 def getProjectionMatrix(self, eye, nearZ: float, farZ: float): ^ SyntaxError: invalid syntax [vive/vive_tracker-5] process has died [pid 11449, exit code 1, cmd /home/glab/catkin_ws/src/vive_tracker/scripts/vive_tracker.py __name:=vive_tracker __log:=/home/glab/.ros/log/1674945c-e610-11eb-be62-709cd13e9815/vive-vive_tracker-5.log]. log file: /home/glab/.ros/log/1674945c-e610-11eb-be62-709cd13e9815/vive-vive_tracker-5*.log Generating vive_world frame.......... I tried to switch my default python interpreter to python3.6 but it also didn’t work. I also tried to use openvr 1.3.2201 which also gave me the same error... I was wondering how you managed to run the files. Did you use python 3.5+ as ROS’s interpreter? Or am I doing something wrong? I have been stuck here for so long.. I hope you can help me. Thank you in advance!

JiyooonPark commented 3 years ago

Oh, it was a simple fix. The problem was with the openvr version. The openvr 1.3.2201 was not installed properly and I had to build it from source. Thank you anyways!

AitorMonreal commented 3 years ago

Hi @JiyooonPark , I'm facing the same issue. Can I ask, how did you build it from source? Thank you!

Edit: Answering myself:

  1. Download tar.gz from https://github.com/cmbruns/pyopenvr/releases/tag/1.3.2201
  2. cd Downloads
  3. tar -xzf pyopenvr-1.3.2201.tar.gz
  4. cd pyopenvr-1.3.2201
  5. sudo python setup.py install