Difference between revisions of "Connect to ROS"
From Lofaro Lab Wiki
Line 5: | Line 5: | ||
1) Install Pre-Built Debians | 1) Install Pre-Built Debians | ||
− | + | <syntaxhighlight lang="bash">sudo apt-get install ros-hydro-gazebo-ros-pkgs ros-hydro-gazebo-ros-control</syntaxhighlight> | |
2) ROS Hydro | 2) ROS Hydro | ||
− | + | <syntaxhighlight lang="bash">sudo apt-get install -y gazebo</syntaxhighlight> | |
Download source code from github repository: | Download source code from github repository: | ||
− | + | <syntaxhighlight lang="bash">cd ~/catkin_ws/src | |
− | git clone https://github.com/ros-simulation/gazebo_ros_pkgs.git -b hydro-devel</ | + | 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 | ||
− | + | <syntaxhighlight lang="bash">rosdep update | |
− | rosdep check --from-paths . --ignore-src --rosdistro hydro</ | + | rosdep check --from-paths . --ignore-src --rosdistro hydro</syntaxhighlight> |
− | + | <syntaxhighlight lang="bash">rosdep install --from-paths . --ignore-src --rosdistro hydro -y</syntaxhighlight> | |
3) Build packages | 3) Build packages | ||
− | + | <syntaxhighlight lang="bash">cd ~/catkin_ws/ | |
− | catkin_make</ | + | catkin_make</syntaxhighlight> |
'''Testing Gazebo with ROS Integration''' | '''Testing Gazebo with ROS Integration''' | ||
1) | 1) | ||
− | + | <syntaxhighlight lang="bash">source /opt/ros/hydro/setup.bash</syntaxhighlight> | |
2) Source catkin setup.bash | 2) Source catkin setup.bash | ||
− | + | <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 | ||
− | + | <syntaxhighlight lang="bash">roscore</syntaxhighlight> | |
− | + | <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) | ||
− | + | <syntaxhighlight lang="bash">roslaunch gazebo_ros empty_world.launch</syntaxhighlight> | |
2) | 2) | ||
− | + | <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