Connect to ROS
From Lofaro Lab Wiki
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