Skip to content

Vector Simulation Setup [DEPRECATED]

Adam Allevato edited this page Aug 29, 2018 · 2 revisions

DEPRECATION NOTICE - This installation procedure is outdated.

Important Notice: this is a condensed version of setup instructions. For details, refer to Stanley wiki page for vector.

System Requirement

  • Ubuntu 14.04 Trusty

Install ROS Indigo

  • sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
  • sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net --recv-key 0xB01FA116
  • sudo apt-get update
  • sudo apt-get install ros-indigo-desktop-full
  • sudo rosdep init
  • rosdep update
  • echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc
  • source ~/.bashrc
  • sudo apt-get install python-rosinstall

Install additional packages

Note that "$ROS_DISTRO" should already be set if ROS is set up correctly.

  • sudo apt-get install ros-$ROS_DISTRO-control-toolbox ros-$ROS_DISTRO-moveit-core ros-$ROS_DISTRO-costmap-2d ros-$ROS_DISTRO-move-base ros-$ROS_DISTRO-jsk-recognition ros-$ROS_DISTRO-controller-manager ros-$ROS_DISTRO-gazebo-ros* ros-$ROS_DISTRO-hector* ros-$ROS_DISTRO-rviz-imu-plugin ros-$ROS_DISTRO-robot-pose-ekf ros-$ROS_DISTRO-robot-localization ros-$ROS_DISTRO-yocs-cmd-vel-mux ros-$ROS_DISTRO-joint-*

Create a Software folder (optional)

  • mkdir ~/Software
  • If you choose to not do this, put packages under vector workspace and ignore all the ln commands in future steps.

Install Freenect2

You should not need to do this if there is another account that has already run these steps. To check, run ls /usr/share/cmake-2.8/Modules/ | grep Findfreenect2 . If the output is 'Findfreenect2.cmake', skip this section.

NOTE and read important information below. Do not start installing yet!

  • These are instructions from the Kinect 2 installation tutorial here. If you use the above link to install Freenect2, do NOT follow the steps to install CUDA! This is an optional step that will have you download the wrong NVIDIA drivers, and will cause you to waste a day trying to figure out why your computer has locked you out. DON'T DO IT!
  • If you are using 14.04: There is a line under "Install OpenGL" that is (Ubuntu 14.04 only) sudo dpkg -i debs/libglfw3*deb; sudo apt-get install -f; sudo apt-get install libgl1-mesa-dri-lts-vivid (If the last command conflicts with other packages, don't do it.) THAT LAST LINE DOES CONFLICT!! Run this ONLY: sudo dpkg -i debs/libglfw3*deb; sudo apt-get install -f. Otherwise, you will have the same problem as above, when it uninstalls the window manager.

To be safe and if you do not need any of the optional dependencies (OpenCL, CUDA, VAAPI, OpenNI2), just follow the steps below:

  • cd ~/Software
  • git clone https://github.com/OpenKinect/libfreenect2.git
  • cd libfreenect2
  • cd depends; ./download_debs_trusty.sh
  • sudo dpkg -i debs/libusb*deb
  • sudo apt-get install libturbojpeg libjpeg-turbo8-dev
  • sudo dpkg -i debs/libglfw3*deb; sudo apt-get install -f
  • cd ..
  • mkdir build && cd build
  • cmake .. -DCMAKE_INSTALL_PREFIX=~/Software/freenect2
  • make install
  • sudo ln -sf ~/Software/freenect2/lib/cmake/freenect2/freenect2Config.cmake /usr/share/cmake-2.8/Modules/Findfreenect2.cmake (make sure to check your cmake version first with cmake --version)*
  • sudo cp ../platform/linux/udev/90-kinect2.rules /etc/udev/rules.d/ (for accessing the Kinect)

*Note that newer versions of freenect may have the freenect2Config.cmake file named as freenect2.cmake.in in the root of the libfreenect project folder.

Install Vector

  • sudo apt-get install libnlopt-dev
  • mkdir -p ~/Software/stanley
  • cd ~/Software/stanley
  • git clone git@github.com:StanleyInnovation/vector_v1.git
  • mkdir -p ~/vector_ws/src
  • ln -s ~/Software/stanley/vector_v1/ ~/vector_ws/src/
  • vi ~/vector_ws/src/vector_v1/vector_network/env-hooks/50.vector_network_config.sh
  • For simulation, uncomment export ROBOT_NETWORK=eth0 and comment out export ROBOT_NETWORK=br0
  • Make sure VECTOR_USE_PLATFORM_ODOMETRY (line 27) in ~/vector_ws/src/vector_v1/vector_common/vector_config/vector_config.sh is set to true
  • For two arms, edit ~/vector_ws/src/vector_v1/vector_common/vector_config/vector_config.sh accordingly (set VECTOR_HAS_TWO_KINOVA_ARMS and VECTOR_HAS_TWO_ROBOTIQ_GRIPPERS to true)
  • cd ~/vector_ws/src
  • catkin_init_workspace

Fix for simulation

  • sudo gedit /opt/ros/indigo/share/hector_pose_estimation/hector_pose_estimation_nodelets.xml
  • Paste the following into the file: <library path="lib/libhector_pose_estimation_nodelet"> <class name="hector_pose_estimation/PoseEstimationNodelet" type="hector_pose_estimation::PoseEstimationNodelet" base_class_type="nodelet::Nodelet"> <description> This nodelet initializes the pose estimation filter with a generic system model driven by IMU measurements only. </description> </class> </library>

Install HLP-R Manipulation Stack

  • sudo apt-get install python-easygui ros-$ROS_DISTRO-ecl-geometry ros-$ROS_DISTRO-moveit-full python-pip

If moveit-full is not found on Kinetic, use ros-$ROS_DISTRO-moveit.

  • sudo pip install --upgrade pip && sudo pip install aenum
  • cd ~/Software
  • git clone https://bitbucket.org/traclabs/trac_ik.git
  • ln -s ~/Software/trac_ik ~/vector_ws/src (Skip this step if you already have trac_ik ROS package installed)
  • git clone -b vector-develop https://github.com/GT-RAIL/wpi_jaco.git
  • ln -s ~/Software/wpi_jaco/wpi_jaco_msgs/ ~/vector_ws/src/
  • ln -s ~/Software/wpi_jaco/wpi_jaco_wrapper/ ~/vector_ws/src/
  • ln -s ~/Software/wpi_jaco/jaco_sdk/ ~/vector_ws/src/
  • git clone https://github.com/GT-RAIL/rail_manipulation_msgs.git
  • ln -s ~/Software/rail_manipulation_msgs/ ~/vector_ws/src/
  • cd stanley
  • git clone https://github.com/StanleyInnovation/robotiq_85_gripper.git
  • ln -s ~/Software/stanley/robotiq_85_gripper/robotiq_85_msgs/ ~/vector_ws/src/
  • cd ~/Software
  • mkdir HLP-R && cd HLP-R
  • git clone git@github.com:HLP-R/hlpr_manipulation.git
  • ln -s ~/Software/HLP-R/hlpr_manipulation/ ~/vector_ws/src/
  • git clone -b 7dof https://github.com/GT-RAIL/kinova-ros.git
  • ln -s ~/Software/kinova-ros ~/vector_ws/src/

Install HLP-R Simulation stack

  • cd ~/Software/HLP-R
  • git clone git@github.com:HLP-R/hlpr_simulator.git
  • ln -s ~/Software/HLP-R/hlpr_simulator/ ~/vector_ws/src/

Install Navigation Packages

  • sudo apt-get install ros-$ROS_DISTRO-navigation ros-$ROS_DISTRO-slam-gmapping
  • WARNING: If gazebo server errors out when running the simulator with a complaint related to tf::TransformBroadcaster() (it has to do with gazebo pluggin), then try either of these options:
    • Source the above vector_config.sh file above and try running with VECTOR_USE_PLATFORM_ODOMETRY=true
    • If it still does, undo the previous changes and clean/rebuild your catkin workspace, then run the simulator.

Build and Test

  • Open a new terminal or source ~/.bashrc
  • cd ~/vector_ws
  • catkin_make
  • source devel/setup.bash
  • roslaunch hlpr_gazebo vector.launch

Bringup

  • Once everything is working fine and all components are installed, there is a custom package that pulls together each of these launch files into a single system. The tutorial on this package can be found here

Troubleshooting

  • If you get an error about “bad address” when trying to do catkin_make (and you are not on the real robot)
    • Change your file: ~/vector_ws/src/vector_network/env-hooks/50.vector_network_config.sh
    • Change the ROS_IP to export ROS_IP=127.0.0.1
  • If you get an error about namespaces when launch gazebo see fix here. Listed below:
    • Specifically, run these commands
    • sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu trusty main" > /etc/apt/sources.list.d/gazebo-latest.list'
    • wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -
    • Then open up “Software Updater” and update Gazebo
  • If you are trying to use TAB-complete after installing and encounter Warning: error while crawling...
    • run sudo umount /home/<useraccount>/.gvfs then sudo rm -rf .gvfs/ replacing with your user account (obviously)
  • If you get an error about unmet dependencies for libcheese-gtk23 and libcheese7 while installing Freenect2, when running command sudo dpkg -i debs/libglfw3*deb; sudo apt-get install -f; sudo apt-get install libgl1-mesa-dri-lts-vivid
    • instead run sudo dpkg -i debs/libglfw3*deb; sudo apt-get install -f; sudo apt-get install libgl1-mesa-dri-lts-vivid libcheese-gtk23 libcheese7 libclutter-1.0-0 libclutter-gtk-1.0-0 libcogl15 libclutter-gst-2.0-0 gstreamer1.0-clutter

Clone this wiki locally