How to run actual robot code in Gazebo Simulation?
gazebo has a node you can start and use it to exchange data:
gazebo_ros_api_plugin

The gazebo_ros_api_plugin plugin, located with the gazebo_ros package,
  initializes a ROS node called "gazebo". It integrates the ROS callback
  scheduler (message passing) with Gazebo's internal scheduler to
  provide the ROS interfaces described below. This ROS API enables a
  user to manipulate the properties of the simulation environment over
  ROS, as well as spawn and introspect on the state of models in the
  environment.
This plugin is only loaded with gzserver.
I am working on Guardian mobile robot. It has 2 ROS packages, one for real robot and other for Gazebo simulation. Mapping and navigation code is available in real robot package and not in Gazebo simulation package. Please tell, how can I run mapping and navigation code in Gazebo package. Thanks