Most complex URDF models use quite a few gazebo plugins. This often means that a dependency to "gazebo_plugins" (or other plugins) exists in the manifest.xml, which in turn means the inclusion of gazebo itself as a dependency. On a real robot or any setup that never simulates the robot model, this is a quite needless and heavyweight dependency. Are there any best practices for working around this in a systematic fashion, so one has a basic URDF model without gazebo dependencies, as well as a simulation version with all gazebo controllers?
I have a few ideas involving two packages, using ENV tags in xacro files and so on, but that seems rather cumbersome to me.
/edit: So here's the scenario that motivated my question: I have a vehicle model in the hector_ugv_description package. This contains the basic urdf file. For this model, I want to pull the low poly hokuyo UTM-30LX urdf model from the hector_sensors_description package. I also want to use a sonar sensor from another package on the vehicle, which uses a custom plugin (that has to be built for the sensor to work in gazebo). So from what I gather, I have to make 6 packages:
Not depending on anything gazebo, for use on real robot (only urdf/xacro and containing gazebo tags):
Depending on gazebo for use in simulation (so plugins are properly built when building with rosmake)
hector_ugv_gazebo (depends on needed plugins, hector_ugv_description, hector_sensors_gazebo and hector sonar_gazebo)
hector_sensors_gazebo (depends on needed plugins and hector_sensors_description)
hector_sonar_gazebo (depends on needed plugins and hector_sonar_description)