OSUrobotics / ros_ovr_sdk

A ROS package which builds the Oculus SDK as a shared library and link the appropriate libraries in other packages that build with it.
MIT License
9 stars 7 forks source link

i have written a code. can anyone check it out why it is not running #8

Open adhamalkhaja opened 8 years ago

adhamalkhaja commented 8 years ago

So, i have written a code using the sdk and ROS; it compiles and builds using catkin all well without any error but once i use rosrun to run the code; everything runs fine but there is no output. this is the code

include

include "/home/adham/bebopOculus_ws/src/ros_ovr_sdk/sdk/ovr_sdk_linux_0.5.0.1/LibOVR/Include/Extras/OVR_Math.h"

include

include<ros/ros.h>

int main(int argc, char **argv) { ros::init(argc,argv, "bebopocu"); ros::NodeHandle nh; ros::Rate rate(2); while (ros::ok){

    if(ovr_Initialize(NULL))
    {
        ovrHmd hmd = ovrHmd_Create(0);

        if (hmd)
        {
            ROS_INFO("Created");

        ovrSizei resolution = hmd->Resolution;

        ovrHmd_Destroy(hmd);

        }
ovr_Shutdown();
rate.sleep();

}

} }

or at least can i have an example of how this is written or where to learn it ?

thanks !

rebhuhnd commented 8 years ago

@uaedronemaster You only need to create and destroy the hmd object once. This program seems to be doing it continuously in a loop, so it might not have finished destroying the object when it calls create again. I don't think the resolution will change so you could save the resoluton before starting the while loop.

Here's an example. Look at Oculus::setupOculus and Oculus::shutDownOculus.

https://github.com/OSUrobotics/oculus_rviz_plugins/blob/groovy-devel/src/ogre_oculus.cpp

And check out the section API Interfaces in the include file.

https://github.com/OSUrobotics/ros_ovr_sdk/blob/master/sdk/ovr_sdk_linux_0.5.0.1/LibOVR/Include/OVR_CAPI_0_5_0.h

adhamalkhaja commented 8 years ago

I have tried running the create and destroy hmd object once, still same problem it gets stuck. I saw the example but can you please tell me what can I understand from that article.

On Mon, Jan 25, 2016 at 10:57 PM, David Rebhuhn notifications@github.com wrote:

You only need to create and destroy the hmd object once. This program seems to be doing it continuously in a loop, so it might not have finished destroying the object when it calls create again. I don't think the resolution will change so you could save the resoluton before starting the while loop.

Here's an example. Look at Oculus::setupOculus and Oculus::shutDownOculus.

https://github.com/OSUrobotics/oculus_rviz_plugins/blob/groovy-devel/src/ogre_oculus.cpp

And check out the section API Interfaces in the include file.

https://github.com/OSUrobotics/ros_ovr_sdk/blob/master/sdk/ovr_sdk_linux_0.5.0.1/LibOVR/Include/OVR_CAPI_0_5_0.h

— Reply to this email directly or view it on GitHub https://github.com/OSUrobotics/ros_ovr_sdk/issues/8#issuecomment-174621205 .

adhamalkhaja commented 8 years ago

and when i open the configUtil software it shows that the hmd service is unavailabe

On Tue, Jan 26, 2016 at 7:48 PM, Adham Al-Khaja admalkhaja@gmail.com wrote:

I have tried running the create and destroy hmd object once, still same problem it gets stuck. I saw the example but can you please tell me what can I understand from that article.

On Mon, Jan 25, 2016 at 10:57 PM, David Rebhuhn notifications@github.com wrote:

You only need to create and destroy the hmd object once. This program seems to be doing it continuously in a loop, so it might not have finished destroying the object when it calls create again. I don't think the resolution will change so you could save the resoluton before starting the while loop.

Here's an example. Look at Oculus::setupOculus and Oculus::shutDownOculus.

https://github.com/OSUrobotics/oculus_rviz_plugins/blob/groovy-devel/src/ogre_oculus.cpp

And check out the section API Interfaces in the include file.

https://github.com/OSUrobotics/ros_ovr_sdk/blob/master/sdk/ovr_sdk_linux_0.5.0.1/LibOVR/Include/OVR_CAPI_0_5_0.h

— Reply to this email directly or view it on GitHub https://github.com/OSUrobotics/ros_ovr_sdk/issues/8#issuecomment-174621205 .

adhamalkhaja commented 8 years ago

meaning that the service is not connected. should i install some kind of driver?

On Tue, Jan 26, 2016 at 8:42 PM, Adham Al-Khaja admalkhaja@gmail.com wrote:

and when i open the configUtil software it shows that the hmd service is unavailabe

On Tue, Jan 26, 2016 at 7:48 PM, Adham Al-Khaja admalkhaja@gmail.com wrote:

I have tried running the create and destroy hmd object once, still same problem it gets stuck. I saw the example but can you please tell me what can I understand from that article.

On Mon, Jan 25, 2016 at 10:57 PM, David Rebhuhn <notifications@github.com

wrote:

You only need to create and destroy the hmd object once. This program seems to be doing it continuously in a loop, so it might not have finished destroying the object when it calls create again. I don't think the resolution will change so you could save the resoluton before starting the while loop.

Here's an example. Look at Oculus::setupOculus and Oculus::shutDownOculus.

https://github.com/OSUrobotics/oculus_rviz_plugins/blob/groovy-devel/src/ogre_oculus.cpp

And check out the section API Interfaces in the include file.

https://github.com/OSUrobotics/ros_ovr_sdk/blob/master/sdk/ovr_sdk_linux_0.5.0.1/LibOVR/Include/OVR_CAPI_0_5_0.h

— Reply to this email directly or view it on GitHub https://github.com/OSUrobotics/ros_ovr_sdk/issues/8#issuecomment-174621205 .