-
Notifications
You must be signed in to change notification settings - Fork 2
Tutorial 2: ROS package
Brad Saund edited this page Apr 29, 2020
·
8 revisions
Next Tutorial 3: Video and RGBD
This second tutorial explains how to:
- Set up the Linux machine (possible in a VM)
- Set up the ROS package for communication to the Unity package
- Run the a simple robot controller and simulated robot
- Interact with the robot in VR
You will need:
- the Windows computer with Unity from the previous tutorial
- a Linux machine with ROS
- These machines need to communicate over the ROS network
- A basic understanding of ROS, with some previous experience
Time: 15min to 1.5hr, depending on computer setup
Complete this section if you would prefer to run some or all of the ROS software on the same windows computer used for Unity.
- Install Virtual Box
- Install Ubuntu (e.g. 18.04)
- Set up the networking to allow communication between VM and host
See this tutorial for details
Set up ROS on the Linux machine
- Clone the following repo as ROS packages (i.e. under the
src
folder):
- Set up communications
- Decide which computer will be ros master, and set the appropriate variables
- Find the IP of the Linux machine (e.g. the virtual machine from above) using
ifconfig
- Enter the Linux machine's IP in the Unity file (RosBridgeSettings -> Mosmaster -> RosBridgeServer URL). It should take the form
ws://xxx.xxx.xxx.xxx:9090
(Note: you can assign a static IP from your router to avoid having to update this value)
From the Linux machine launch (in separate terminal windows)
roscore
roslaunch victor_fake_hardware_interface fake_dual_arm_lcm_bridge.launch
-
rosrun dual_arm_teleop make_victor_fast.py
and thenroslaunch unity_launch_files unity_setup.launch
- From Unity, launch ("play") the project. (Note: The VR interface should launch right away. If it hangs for a few seconds, likely the VR system cannot communicate with ROS)
You should see the Robot with his hands in the air.
Grab one of the robot's hands with your hands. Move you hand up and "click" the side gripper buttons on your VR controller.You can drag the Robot's hand around.
Here are some common errors I have found.
- If the VR system launches but it takes while, and/or you see the error message that the RosBridge cannot connect, double check the IP entered in Unity for the Rosmaster script. Note that
ifconfig
may report multiple interfaces. Try cycling through all of them - If the VR system launches and the Rosbridge connection is successful but the terminal with the
fake_victor_hardware_interface
is reporting an invalidmode
, Re-runrosrun dual_arm_teleop make_victor_fast.py
. The robot (Victor) must be in the correct mode to accept joint position commands - If the VR system launches but the robot does not move and you've checked the above issues, try moving more slowly. The robot will reject large motions