zhenyushi / vrui_mdf

"Vrui modified" for use with HTC Vive and ROS + Gazebo
BSD 3-Clause "New" or "Revised" License
8 stars 3 forks source link

Unable to find vrui_mdf/Vive.h #1

Open CameronDevine opened 5 years ago

CameronDevine commented 5 years ago

I am trying to build vrui_mdf, but I am unable to find the Vive.h file. I have looked in both vrui and vrui_mdf for this file with no luck. Where can I find this file so I can build this package?

cmcghan commented 5 years ago

I'll ask my student about this -- stay tuned!

zhenyushi commented 5 years ago

I am trying to build vrui_mdf, but I am unable to find the Vive.h file. I have looked in both vrui and vrui_mdf for this file with no luck. Where can I find this file so I can build this package?

Hi, if you're talking about the line "#include <vrui_mdf/Vive.h>" in the tracking.cpp file, it's the header file for our custom message, when you're compiling with "catkin_make", it should be generated under the folder "~/catkin_ws/devel/include/vrui_mdf"

When we built the package, we basically followed this page, treated it as a ros package, and put it under "catkin_ws/src".

What kind compiling issue are you having? Please let me, I'm glad if I can help.

zhenyushi commented 5 years ago

Sorry, I closed this issue by accident, now it's reopened.

cmcghan commented 5 years ago

If you can let us know how far you got in the process following the README.md file, that would also be helpful! (If you only just installed some of the video card drivers, you may actually need to reboot the Ubuntu PC.) Also, is it Ubuntu 16.04 with ROS Kinetic that you are using? Or something else?

(More specifically, Vive.h is compiled when catkin_make automatically runs message_generation on the vrui_mdf/msg/Vive.msg file. catkin_make should be able to find / link the .h header file(s) appropriately from the workspace devel directory during the rest of the ROS package compilation process -- but if it isn't, then please send us the error message text from the terminal so we can help debug the problem!)

CameronDevine commented 5 years ago

I was able to get the library to build by running catkin_make vrui_mdf_generate_mesages_cpp then running catkin_make again. I expect a dependency needs to be added to the imagesub target to ensure that the vrui_mdf_generate_mesages_cpp target is run before the imagesub target.

I also had to change line 154 on the CMake file from,

set(VRUI "$ENV{HOME}/src/Vrui-4.2-006")

to,

set(VRUI "$ENV{HOME}/src/Vrui-4.5-001")

to match the version of Vrui specified elsewhere.

I will start working on adding vrui_mdf to my simulation and let you know of any other issues I run into, or when I get it working.

CameronDevine commented 5 years ago

I realized I should keep this open because these issues should be fixed.

cmcghan commented 5 years ago

Hmm, okay. Thought we had fixed the CMakeLists.txt and package.xml, but I guess the new module adds broke it again (drat). I think you're right about that version line being problematic and the (currently absent) add_dependencies(imagesub, ...) line that needs to be added into that file. Thank you for letting us know! (We'll have to get that warning added into the readme file, re: extensibility later.)

Looks like line 14 (and technically also line 339) of vrui_mdf/scripts/cod_edi.py has the current (only absolutely explicit?) dependency hardcoded in for Vrui-4.5-001 (instead of the newest 4.5-004?) as well. So this means that the vrui_mdf/src/tracking.cpp will not be generated if you have a different version of Vrui, currently. (I'll see about setting up a specific pull/grab from their github repo as part of the python script, just to consistently not have to worry about possible broken file stitching operations with future versions of the file, for the code compile for now; I'll see about looking into something a little more automated to detect the current system-installed version of Vrui for using that instead, as well.)

Once we get these fixes in, if you'd like to help debug (before we close this issue)... would you try deleting the top-level build and devel directories from your catkin workspace, then opening a new terminal (so that the variables that were set by devel/setup.bash for the workspace are not loaded) and running catkin_make in the top-level directory again (without arguments)? This will tell me whether the message compilation issue is persistent, even with the CMakeLists.txt fix for your setup, if it errors again and still requires the specific forced-call. --We're not quite ready to have you try this yet, but please do let us know if you're willing?

CameronDevine commented 5 years ago

I would be happy to put together a pull request fixing the issues I encountered here. I also have a couple ideas on how to make the installation easier.

cmcghan commented 5 years ago

Admittedly, we don't have a form (contributor agreement) made up yet to allow for pulling in commits to repositories from folks outside the research lab. Zhenyu (my PhD student working on the project) should have the majority of the fixes up sometime tomorrow afternoon EST.

For installation, I was planning on writing up another bash script to live inside AS4SR/vagrant-rss/single_installers that would largely automate the process. (Only reason I haven't yet is because I was naively hoping to automate the video card driver install process an age ago.) I'm happy to take suggestions, though! :) (And yes, the current scripts there are a bit esoteric, partially because I tried to make them a bit more robust and flexible... I'm working on cleaning those scripts up somewhat.) Let me know?

CameronDevine commented 5 years ago

Looking through the existing CMake file it looks like Vrui does not need to be built, the source is only needed so it can be edited by cod_edi.py then compiled into ros nodes. I threw together a bit of CMake code that would automatically download and unpack Vrui, then run cod_edi.py. The release of Vrui to use is set in a variable, which is then also passed as a command line argument to cod_edi.py. This would remove any issues where conflicting versions of Vrui are required in different files. I haven't tested this code, but I think this would allow vrui_mdf to be installed by cloning the repository and simply running catkin_make.

set(VRUI_RELEASE "4.5-004")
file(DOWNLOAD
    "http://idav.ucdavis.edu/~okreylos/ResDev/Vrui/Vrui-${VRUI_RELEASE}.tar.gz"
    ${CMAKE_CURRENT_SOURCE_DIR}/vrui/Vrui-${VRUI_RELEASE}.tar.gz
)
find_package(Python COMPONENTS Interpreter)
execute_process(
    COMMAND tar -xzf ${CMAKE_CURRENT_SOURCE_DIR}/vrui/Vrui-${VRUI_RELEASE}.tar.gz
    COMMAND ${Python_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/scripts/cod_edi.py ${VRUI_RELEASE}
    WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/vrui/Vrui-${VRUI_RELEASE})
cmcghan commented 5 years ago

Actually, Vrui_server.cpp runs RunViveTracker.sh, which requires Vrui to be compiled and installed system-wide. The Vrui libraries are necessary to talk to SteamVR with this setup (since when we started this project, SteamVR for Linux was in beta).

Running system commands and the Python interpreter from inside the CMakeLists.txt file is pretty slick. I didn't know you could do that! I'll check that out :) ...Not sure if doing it this way will have catkin_make trying to download every time or not. Will definitely look into this :)

cmcghan commented 5 years ago

(Man, they really stick those buttons right next to each other...)

CameronDevine commented 5 years ago

It looks like this can be fixed by first checking if the file exists,

if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/vrui/Vrui-${VRUI_RELEASE}.tar.gz)
    file(DOWNLOAD
        "http://idav.ucdavis.edu/~okreylos/ResDev/Vrui/Vrui-${VRUI_RELEASE}.tar.gz"
        ${CMAKE_CURRENT_SOURCE_DIR}/vrui/Vrui-${VRUI_RELEASE}.tar.gz
    )
endif()
Dont-Hesitate commented 3 years ago

Hello,I couldn’t find the tracking file in your src package,please help me,thank you.

zhenyushi commented 3 years ago

Hello,I couldn’t find the tracking file in your src package,please help me,thank you.

Hi, there's a python script you need to run to generate the tracking file, see the "Before implementation" sectoin of the README. Let us know if you need further assistance

Dont-Hesitate commented 3 years ago

Hello,I couldn’t find the tracking file in your src package,please help me,thank you.

Hi, there's a python script you need to run to generate the tracking file, see the "Before implementation" sectoin of the README. Let us know if you need further assistance

Thank you for your reply. I'd like to know if steamVR needs the specific version you said. I'm using the latest version now . Can your plug-in run in the latest version of steamvr?We look forward to your reply.

Dont-Hesitate commented 3 years ago

Hello,I couldn’t find the tracking file in your src package,please help me,thank you.

Hi, there's a python script you need to run to generate the tracking file, see the "Before implementation" sectoin of the README. Let us know if you need further assistance

Thank you for your reply. I'd like to know if steamVR needs the specific version you said. I'm using the latest version now . Can your plug-in run in the latest version of steamvr?We look forward to your reply.

This is an error I reported when catkin_make: /home/ros-kinetic/catkin/src/vrui_mdf/src/tracking.cpp:143:1: error: ‘eyePosVersions’ does not name a type eyePosVersions[index]=hmdConfiguration.getEyePosVersion(); ^ /home/ros-kinetic/catkin/src/vrui_mdf/src/tracking.cpp:144:1: error: expected declaration before ‘}’ token } ^ vrui_mdf/CMakeFiles/tracking.dir/build.make:62: recipe for target 'vrui_mdf/CMakeFiles/tracking.dir/src/tracking.cpp.o' failed make[2]: [vrui_mdf/CMakeFiles/tracking.dir/src/tracking.cpp.o] Error 1 CMakeFiles/Makefile2:15783: recipe for target 'vrui_mdf/CMakeFiles/tracking.dir/all' failed make[1]: [vrui_mdf/CMakeFiles/tracking.dir/all] Error 2 Makefile:138: recipe for target 'all' failed make: *** [all] Error 2 Invoking "make -j24 -l24" failed