Difference between revisions of "Connect to ROS"

From Lofaro Lab Wiki
Jump to: navigation, search
 
Line 5: Line 5:
 
1) Install Pre-Built Debians
 
1) Install Pre-Built Debians
  
    <nowiki>sudo apt-get install ros-hydro-gazebo-ros-pkgs ros-hydro-gazebo-ros-control</nowiki>
+
<syntaxhighlight lang="bash">sudo apt-get install ros-hydro-gazebo-ros-pkgs ros-hydro-gazebo-ros-control</syntaxhighlight>
  
 
2) ROS Hydro  
 
2) ROS Hydro  
  
    <nowiki>sudo apt-get install -y gazebo</nowiki>
+
<syntaxhighlight lang="bash">sudo apt-get install -y gazebo</syntaxhighlight>
  
 
Download source code from github repository:
 
Download source code from github repository:
  
    <nowiki>cd ~/catkin_ws/src
+
<syntaxhighlight lang="bash">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</syntaxhighlight>
  
 
Check for any missing dependencies and automatically install them
 
Check for any missing dependencies and automatically install them
  
    <nowiki>rosdep update
+
<syntaxhighlight lang="bash">rosdep update
rosdep check --from-paths . --ignore-src --rosdistro hydro</nowiki>
+
rosdep check --from-paths . --ignore-src --rosdistro hydro</syntaxhighlight>
    <nowiki>rosdep install --from-paths . --ignore-src --rosdistro hydro -y</nowiki>
+
<syntaxhighlight lang="bash">rosdep install --from-paths . --ignore-src --rosdistro hydro -y</syntaxhighlight>
  
 
3) Build packages
 
3) Build packages
  
    <nowiki>cd ~/catkin_ws/
+
<syntaxhighlight lang="bash">cd ~/catkin_ws/
catkin_make</nowiki>
+
catkin_make</syntaxhighlight>
  
 
'''Testing Gazebo with ROS Integration'''
 
'''Testing Gazebo with ROS Integration'''
  
 
1)  
 
1)  
    <nowiki>source /opt/ros/hydro/setup.bash</nowiki>
+
<syntaxhighlight lang="bash">source /opt/ros/hydro/setup.bash</syntaxhighlight>
  
 
2) Source catkin setup.bash
 
2) Source catkin setup.bash
  
    <nowiki>source ~/catkin_ws/devel/setup.bash</nowiki>
+
<syntaxhighlight lang="bash">source ~/catkin_ws/devel/setup.bash</syntaxhighlight>
  
 
3) Run roscore in one terminal and rosrun gazebo_ros gazebo in another terminal
 
3) Run roscore in one terminal and rosrun gazebo_ros gazebo in another terminal
  
    <nowiki>roscore</nowiki>
+
<syntaxhighlight lang="bash">roscore</syntaxhighlight>
    <nowiki>rosrun gazebo_ros gazebo</nowiki>
+
<syntaxhighlight lang="bash">rosrun gazebo_ros gazebo</syntaxhighlight>
  
 
'''Using roslaunch to start Gazebo, world files and URDF models'''
 
'''Using roslaunch to start Gazebo, world files and URDF models'''
  
 
1)  
 
1)  
    <nowiki>roslaunch gazebo_ros empty_world.launch</nowiki>
+
<syntaxhighlight lang="bash">roslaunch gazebo_ros empty_world.launch</syntaxhighlight>
  
 
2)  
 
2)  
    <nowiki>roslaunch gazebo_ros empty_world.launch</nowiki>
+
<syntaxhighlight lang="bash">roslaunch gazebo_ros empty_world.launch</syntaxhighlight>

Latest revision as of 00:13, 12 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