Difference between revisions of "Connect to ROS"

From Lofaro Lab Wiki
Jump to: navigation, search
(Created page with "==Installing gazebo_ros_pkgs== '''Install gazebo_ros_pkgs''' 1) Install Pre-Built Debians <nowiki>sudo apt-get install ros-hydro-gazebo-ros-pkgs ros-hydro-gazebo-ros-c...")
 
Line 11: Line 11:
 
     <nowiki>sudo apt-get install -y gazebo</nowiki>
 
     <nowiki>sudo apt-get install -y gazebo</nowiki>
  
    Download source code from github repository:
+
Download source code from github repository:
  
 
     <nowiki>cd ~/catkin_ws/src
 
     <nowiki>cd ~/catkin_ws/src
 
git clone https://github.com/ros-simulation/gazebo_ros_pkgs.git -b hydro-devel</nowiki>
 
git clone https://github.com/ros-simulation/gazebo_ros_pkgs.git -b hydro-devel</nowiki>
  
    Check for any missing dependencies and automatically install them
+
Check for any missing dependencies and automatically install them
  
 
     <nowiki>rosdep update
 
     <nowiki>rosdep update

Revision as of 00:58, 5 November 2014

Installing gazebo_ros_pkgs

Install gazebo_ros_pkgs

1) Install Pre-Built Debians

    sudo apt-get install ros-hydro-gazebo-ros-pkgs ros-hydro-gazebo-ros-control

2) ROS Hydro

    sudo apt-get install -y gazebo

Download source code from github repository:

    cd ~/catkin_ws/src
git clone https://github.com/ros-simulation/gazebo_ros_pkgs.git -b hydro-devel

Check for any missing dependencies and automatically install them

    rosdep update
rosdep check --from-paths . --ignore-src --rosdistro hydro
    rosdep install --from-paths . --ignore-src --rosdistro hydro -y

3) Build packages

    cd ~/catkin_ws/
catkin_make

Testing Gazebo with ROS Integration

1)

    source /opt/ros/hydro/setup.bash

2) Source catkin setup.bash

    source ~/catkin_ws/devel/setup.bash

3) Run roscore in one terminal and rosrun gazebo_ros gazebo in another terminal

    roscore
    rosrun gazebo_ros gazebo

Using roslaunch to start Gazebo, world files and URDF models

1)

    roslaunch gazebo_ros empty_world.launch

2)

    roslaunch gazebo_ros empty_world.launch