Working with the ROS-VR application and interfacing with Gazebo

The new APK will be installed with a name such as ROSSerial; before starting this app, we need to set a few things up on the ROS PC.

The next step is to set the ROS_IP variable in the .bashrc file. Execute the ifconfig command and retrieve the Wi-Fi IP address of the PC, as shown here:

Figure 13: PC Wi-Fi adapter IP address

For this project, the IP address was 192.168.1.101, so we have to set the ROS_IP variable as the current IP in .bashrc. You can simply copy the following line to the .bashrc file:

    $ export ROS_IP=192.168.1.101

We need to set this; only then will the Android VR app work.

Now start the roscore command on the ROS PC:

    $ roscore

The next step is to open the Android app, and you will get a window like the following. Enter ROS_IP in the edit box and click on the CONNECT button.

Figure 14: ROS-VR application

If the app is connected to the ROS master on the PC, it will show up as connected and show a blank screen with a split view. Now list out the topics on the ROS PC:

Figure 15: Listing ROS-VR topics on PC

You can see topics such as /usb_cam/image_raw/compressed or /camera/image/compressed in the list, and what we want to do is feed a compressed image to whatever image topic the app is going to subscribe to. If you've installed the usb_cam (https://github.com/bosch-ros-pkg/usb_cam) ROS package already, you can launch the webcam driver using the following command:

    $ roslaunch usb_cam usb_cam-test.launch

This driver will publish the camera image in compressed form to the /usb_cam/image_raw/compressed topic, and when there is a publisher for this topic, it will display it on the app also. If you are getting some other topics from the app, say, /camera/image/compressed, you can use topic_tools (http://wiki.ros.org/topic_tools) for remapping the topic to the app topic. You can use the following command:

    $ rosrun topic_tools relay /usb_cam/image_raw/compressed /camera/image/compressed

Now, you can see the camera view in the VR app like this:

Figure 16: ROS-VR app

This is the split view that we are getting in the application. We can also display images from Gazebo in the similar manner. Simple, right? Just remap the robot camera compressed image to the app topic. In the next section, we will learn how to view Gazebo images in the VR app.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.12.172