RenderingFixture Class Reference

#include <ServerFixture.hh>

Inherits ServerFixture.

Public Member Functions

virtual void SetUp ()
 

Protected Member Functions

void DoubleCompare (double *_scanA, double *_scanB, unsigned int _sampleCount, double &_diffMax, double &_diffSum, double &_diffAvg)
 Function to compare two double arrays (for example two laser scans). More...
 
ignition::math::Pose3d EntityPose (const std::string &_name)
 Get the pose of an entity. More...
 
void FloatCompare (float *_scanA, float *_scanB, unsigned int _sampleCount, float &_diffMax, float &_diffSum, float &_diffAvg)
 Function to compare two float arrays (for example two laser scans). More...
 
math::Pose GetEntityPose (const std::string &_name) GAZEBO_DEPRECATED(8.0)
 Get the pose of an entity. More...
 
void GetFrame (const std::string &_cameraName, unsigned char **_imgData, unsigned int &_width, unsigned int &_height)
 Get an image frame from a camera. More...
 
void GetMemInfo (double &_resident, double &_share)
 Get the current memory information. More...
 
physics::ModelPtr GetModel (const std::string &_name)
 Get a pointer to a model. More...
 
double GetPercentRealTime () const
 Get the real-time factor. More...
 
rendering::ScenePtr GetScene (const std::string &_sceneName="default")
 Get a pointer to the rendering scene. More...
 
std::string GetUniqueString (const std::string &_prefix)
 Get unique string with a specified prefix. More...
 
bool HasEntity (const std::string &_name)
 Return true if the named entity exists. More...
 
void ImageCompare (unsigned char *_imageA, unsigned char *_imageB, unsigned int _width, unsigned int _height, unsigned int _depth, unsigned int &_diffMax, unsigned int &_diffSum, double &_diffAvg)
 Function to compare two images. More...
 
virtual void Load (const std::string &_worldFilename)
 Load a world based on a filename. More...
 
virtual void Load (const std::string &_worldFilename, bool _paused)
 Load a world based on a filename and set simulation paused/un-paused. More...
 
virtual void Load (const std::string &_worldFilename, bool _paused, const std::string &_physics, const std::vector< std::string > &_systemPlugins={})
 Load a world based on a filename and set simulation paused/un-paused, and specify physics engine. More...
 
virtual void LoadArgs (const std::string &_args)
 Load a world in gzserver. More...
 
void LoadPlugin (const std::string &_filename, const std::string &_name)
 Load a plugin. More...
 
void OnPose (ConstPosesStampedPtr &_msg)
 Function that received poses messages from a running simulation. More...
 
void OnStats (ConstWorldStatisticsPtr &_msg)
 Function that received world stastics messages. More...
 
void PrintImage (const std::string &_name, unsigned char **_image, unsigned int _width, unsigned int _height, unsigned int _depth)
 Print image data to screen. More...
 
void PrintScan (const std::string &_name, double *_scan, unsigned int _sampleCount)
 Print laser scan to screen. More...
 
void Record (const std::string &_name, const double _data)
 Helper to record data to gtest xml output. More...
 
void Record (const std::string &_prefix, const ignition::math::SignalStats &_stats)
 Helper to record signal statistics to gtest xml output. More...
 
void Record (const std::string &_prefix, const ignition::math::Vector3Stats &_stats)
 Helper to record Vector3d signal statistics to gtest xml output. More...
 
void RemoveModel (const std::string &_name)
 Remove a model by name. More...
 
void RemovePlugin (const std::string &_name)
 Remove a plugin. More...
 
void RunServer (const std::vector< std::string > &_args)
 Run the server. More...
 
void SetPause (bool _pause)
 Set a running simulation paused/unpaused. More...
 
void SpawnBox (const std::string &_name, const math::Vector3 &_size, const math::Vector3 &_pos, const math::Vector3 &_rpy, bool _static=false) GAZEBO_DEPRECATED(8.0)
 Spawn a box. More...
 
void SpawnBox (const std::string &_name, const ignition::math::Vector3d &_size=ignition::math::Vector3d::One, const ignition::math::Vector3d &_pos=ignition::math::Vector3d::Zero, const ignition::math::Vector3d &_rpy=ignition::math::Vector3d::Zero, bool _static=false)
 Spawn a box. More...
 
void SpawnCamera (const std::string &_modelName, const std::string &_cameraName, const math::Vector3 &_pos, const math::Vector3 &_rpy, unsigned int _width=320, unsigned int _height=240, double _rate=25, const std::string &_noiseType="", double _noiseMean=0.0, double _noiseStdDev=0.0, bool _distortion=false, double _distortionK1=0.0, double _distortionK2=0.0, double _distortionK3=0.0, double _distortionP1=0.0, double _distortionP2=0.0, double _cx=0.5, double _cy=0.5) GAZEBO_DEPRECATED(8.0)
 Spawn a camera. More...
 
void SpawnCamera (const std::string &_modelName, const std::string &_cameraName, const ignition::math::Vector3d &_pos=ignition::math::Vector3d::Zero, const ignition::math::Vector3d &_rpy=ignition::math::Vector3d::Zero, unsigned int _width=320, unsigned int _height=240, double _rate=25, const std::string &_noiseType="", double _noiseMean=0.0, double _noiseStdDev=0.0, bool _distortion=false, double _distortionK1=0.0, double _distortionK2=0.0, double _distortionK3=0.0, double _distortionP1=0.0, double _distortionP2=0.0, double _cx=0.5, double _cy=0.5)
 Spawn a camera. More...
 
void SpawnCylinder (const std::string &_name, const math::Vector3 &_pos, const math::Vector3 &_rpy, bool _static=false) GAZEBO_DEPRECATED(8.0)
 Spawn a cylinder. More...
 
void SpawnCylinder (const std::string &_name, const ignition::math::Vector3d &_pos=ignition::math::Vector3d::Zero, const ignition::math::Vector3d &_rpy=ignition::math::Vector3d::Zero, bool _static=false)
 Spawn a cylinder. More...
 
void SpawnDepthCameraSensor (const std::string &_modelName, const std::string &_cameraName, const ignition::math::Vector3d &_pos=ignition::math::Vector3d::Zero, const ignition::math::Vector3d &_rpy=ignition::math::Vector3d::Zero, const unsigned int _width=320, const unsigned int _height=240, const double _rate=25, const double _near=0.1, const double _far=10)
 Spawn a depth camera. More...
 
void SpawnEmptyLink (const std::string &_name, const math::Vector3 &_pos, const math::Vector3 &_rpy, bool _static=false) GAZEBO_DEPRECATED(8.0)
 Spawn an empty link. More...
 
void SpawnEmptyLink (const std::string &_name, const ignition::math::Vector3d &_pos=ignition::math::Vector3d::Zero, const ignition::math::Vector3d &_rpy=ignition::math::Vector3d::Zero, bool _static=false)
 Spawn an empty link. More...
 
void SpawnGpuRaySensor (const std::string &_modelName, const std::string &_raySensorName, const math::Vector3 &_pos, const math::Vector3 &_rpy, double _hMinAngle=-2.0, double _hMaxAngle=2.0, double _minRange=0.08, double _maxRange=10, double _rangeResolution=0.01, unsigned int _samples=640, const std::string &_noiseType="", double _noiseMean=0.0, double _noiseStdDev=0.0) GAZEBO_DEPRECATED(8.0)
 Spawn a gpu laser. More...
 
void SpawnGpuRaySensor (const std::string &_modelName, const std::string &_raySensorName, const ignition::math::Vector3d &_pos=ignition::math::Vector3d::Zero, const ignition::math::Vector3d &_rpy=ignition::math::Vector3d::Zero, double _hMinAngle=-2.0, double _hMaxAngle=2.0, double _minRange=0.08, double _maxRange=10, double _rangeResolution=0.01, unsigned int _samples=640, const std::string &_noiseType="", double _noiseMean=0.0, double _noiseStdDev=0.0)
 Spawn a gpu laser. More...
 
void SpawnImuSensor (const std::string &_modelName, const std::string &_imuSensorName, const math::Vector3 &_pos, const math::Vector3 &_rpy, const std::string &_noiseType="", double _rateNoiseMean=0.0, double _rateNoiseStdDev=0.0, double _rateBiasMean=0.0, double _rateBiasStdDev=0.0, double _accelNoiseMean=0.0, double _accelNoiseStdDev=0.0, double _accelBiasMean=0.0, double _accelBiasStdDev=0.0) GAZEBO_DEPRECATED(8.0)
 Spawn an imu sensor laser. More...
 
void SpawnImuSensor (const std::string &_modelName, const std::string &_imuSensorName, const ignition::math::Vector3d &_pos=ignition::math::Vector3d::Zero, const ignition::math::Vector3d &_rpy=ignition::math::Vector3d::Zero, const std::string &_noiseType="", double _rateNoiseMean=0.0, double _rateNoiseStdDev=0.0, double _rateBiasMean=0.0, double _rateBiasStdDev=0.0, double _accelNoiseMean=0.0, double _accelNoiseStdDev=0.0, double _accelBiasMean=0.0, double _accelBiasStdDev=0.0)
 Spawn an imu sensor laser. More...
 
void SpawnLight (const std::string &_name, const std::string &_type, const math::Vector3 &_pos, const math::Vector3 &_rpy, const common::Color &_diffuse=common::Color::White, const common::Color &_specular=common::Color::White, const math::Vector3 &_direction=-math::Vector3::UnitZ, double _attenuationRange=20, double _attenuationConstant=0.5, double _attenuationLinear=0.01, double _attenuationQuadratic=0.001, double _spotInnerAngle=0, double _spotOuterAngle=0, double _spotFallOff=0, bool _castShadows=true) GAZEBO_DEPRECATED(8.0)
 Spawn a light. More...
 
void SpawnLight (const std::string &_name, const std::string &_type, const ignition::math::Vector3d &_pos=ignition::math::Vector3d::Zero, const ignition::math::Vector3d &_rpy=ignition::math::Vector3d::Zero, const common::Color &_diffuse=common::Color::White, const common::Color &_specular=common::Color::White, const ignition::math::Vector3d &_direction=-ignition::math::Vector3d::UnitZ, double _attenuationRange=20, double _attenuationConstant=0.5, double _attenuationLinear=0.01, double _attenuationQuadratic=0.001, double _spotInnerAngle=0, double _spotOuterAngle=0, double _spotFallOff=0, bool _castShadows=true)
 Spawn a light. More...
 
physics::ModelPtr SpawnModel (const msgs::Model &_msg)
 Spawn a model from a msgs::Model and return ModelPtr. More...
 
void SpawnModel (const std::string &_filename)
 Spawn a model from file. More...
 
void SpawnRaySensor (const std::string &_modelName, const std::string &_raySensorName, const math::Vector3 &_pos, const math::Vector3 &_rpy, double _hMinAngle=-2.0, double _hMaxAngle=2.0, double _vMinAngle=-1.0, double _vMaxAngle=1.0, double _minRange=0.08, double _maxRange=10, double _rangeResolution=0.01, unsigned int _samples=640, unsigned int _vSamples=1, double _hResolution=1.0, double _vResolution=1.0, const std::string &_noiseType="", double _noiseMean=0.0, double _noiseStdDev=0.0) GAZEBO_DEPRECATED(8.0)
 Spawn a laser. More...
 
void SpawnRaySensor (const std::string &_modelName, const std::string &_raySensorName, const ignition::math::Vector3d &_pos=ignition::math::Vector3d::Zero, const ignition::math::Vector3d &_rpy=ignition::math::Vector3d::Zero, double _hMinAngle=-2.0, double _hMaxAngle=2.0, double _vMinAngle=-1.0, double _vMaxAngle=1.0, double _minRange=0.08, double _maxRange=10, double _rangeResolution=0.01, unsigned int _samples=640, unsigned int _vSamples=1, double _hResolution=1.0, double _vResolution=1.0, const std::string &_noiseType="", double _noiseMean=0.0, double _noiseStdDev=0.0)
 Spawn a laser. More...
 
void SpawnSDF (const std::string &_sdf)
 Send a factory message based on an SDF string. More...
 
sensors::SonarSensorPtr SpawnSonar (const std::string &_modelName, const std::string &_sonarName, const ignition::math::Pose3d &_pose, const double _minRange, const double _maxRange, const double _radius)
 Spawn a sonar. More...
 
void SpawnSphere (const std::string &_name, const math::Vector3 &_pos, const math::Vector3 &_rpy, bool _wait=true, bool _static=false) GAZEBO_DEPRECATED(8.0)
 Spawn a sphere. More...
 
void SpawnSphere (const std::string &_name, const ignition::math::Vector3d &_pos, const ignition::math::Vector3d &_rpy, bool _wait=true, bool _static=false)
 Spawn a sphere. More...
 
void SpawnSphere (const std::string &_name, const math::Vector3 &_pos, const math::Vector3 &_rpy, const math::Vector3 &_cog, double _radius, bool _wait=true, bool _static=false) GAZEBO_DEPRECATED(8.0)
 Spawn a sphere. More...
 
void SpawnSphere (const std::string &_name, const ignition::math::Vector3d &_pos, const ignition::math::Vector3d &_rpy, const ignition::math::Vector3d &_cog, double _radius=1.0, bool _wait=true, bool _static=false)
 Spawn a sphere. More...
 
void SpawnTrimesh (const std::string &_name, const std::string &_modelPath, const math::Vector3 &_scale, const math::Vector3 &_pos, const math::Vector3 &_rpy, bool _static=false) GAZEBO_DEPRECATED(8.0)
 Spawn a triangle mesh. More...
 
void SpawnTrimesh (const std::string &_name, const std::string &_modelPath, const ignition::math::Vector3d &_scale=ignition::math::Vector3d::One, const ignition::math::Vector3d &_pos=ignition::math::Vector3d::Zero, const ignition::math::Vector3d &_rpy=ignition::math::Vector3d::Zero, bool _static=false)
 Spawn a triangle mesh. More...
 
void SpawnUnitAltimeterSensor (const std::string &_name, const std::string &_sensorName, const std::string &_collisionType, const std::string &_topic, const ignition::math::Vector3d &_pos=ignition::math::Vector3d::Zero, const ignition::math::Vector3d &_rpy=ignition::math::Vector3d::Zero, bool _static=false)
 Spawn an altimeter sensor on a link. More...
 
void SpawnUnitContactSensor (const std::string &_name, const std::string &_sensorName, const std::string &_collisionType, const math::Vector3 &_pos, const math::Vector3 &_rpy, bool _static=false) GAZEBO_DEPRECATED(8.0)
 Spawn a contact sensor with the specified collision geometry. More...
 
void SpawnUnitContactSensor (const std::string &_name, const std::string &_sensorName, const std::string &_collisionType, const ignition::math::Vector3d &_pos=ignition::math::Vector3d::Zero, const ignition::math::Vector3d &_rpy=ignition::math::Vector3d::Zero, bool _static=false)
 Spawn a contact sensor with the specified collision geometry. More...
 
void SpawnUnitImuSensor (const std::string &_name, const std::string &_sensorName, const std::string &_collisionType, const std::string &_topic, const math::Vector3 &_pos, const math::Vector3 &_rpy, bool _static=false) GAZEBO_DEPRECATED(8.0)
 Spawn an IMU sensor on a link. More...
 
void SpawnUnitImuSensor (const std::string &_name, const std::string &_sensorName, const std::string &_collisionType, const std::string &_topic, const ignition::math::Vector3d &_pos=ignition::math::Vector3d::Zero, const ignition::math::Vector3d &_rpy=ignition::math::Vector3d::Zero, bool _static=false)
 Spawn an IMU sensor on a link. More...
 
void SpawnUnitMagnetometerSensor (const std::string &_name, const std::string &_sensorName, const std::string &_collisionType, const std::string &_topic, const ignition::math::Vector3d &_pos=ignition::math::Vector3d::Zero, const ignition::math::Vector3d &_rpy=ignition::math::Vector3d::Zero, bool _static=false)
 Spawn a magnetometer sensor on a link. More...
 
void SpawnWideAngleCamera (const std::string &_modelName, const std::string &_cameraName, const ignition::math::Vector3d &_pos=ignition::math::Vector3d::Zero, const ignition::math::Vector3d &_rpy=ignition::math::Vector3d::Zero, unsigned int _width=320, unsigned int _height=240, double _rate=25, const double _hfov=60, const std::string &_lensType="stereographic", const bool _scaleToHfov=true, const double _cutoffAngle=3.1415, const double _envTextureSize=512, const double _c1=1.05, const double _c2=4, const double _f=1.0, const std::string &_fun="tan")
 Spawn a wide angle camera. More...
 
void SpawnWirelessReceiverSensor (const std::string &_name, const std::string &_sensorName, const math::Vector3 &_pos, const math::Vector3 &_rpy, double _minFreq, double _maxFreq, double _power, double _gain, double _sensitivity, bool _visualize=true) GAZEBO_DEPRECATED(8.0)
 Spawn an Wireless receiver sensor on a link. More...
 
void SpawnWirelessReceiverSensor (const std::string &_name, const std::string &_sensorName, const ignition::math::Vector3d &_pos, const ignition::math::Vector3d &_rpy, double _minFreq, double _maxFreq, double _power, double _gain, double _sensitivity, bool _visualize=true)
 Spawn an Wireless receiver sensor on a link. More...
 
void SpawnWirelessTransmitterSensor (const std::string &_name, const std::string &_sensorName, const math::Vector3 &_pos, const math::Vector3 &_rpy, const std::string &_essid, double _freq, double _power, double _gain, bool _visualize=true) GAZEBO_DEPRECATED(8.0)
 Spawn an Wireless transmitter sensor on a link. More...
 
void SpawnWirelessTransmitterSensor (const std::string &_name, const std::string &_sensorName, const ignition::math::Vector3d &_pos, const ignition::math::Vector3d &_rpy, const std::string &_essid, double _freq, double _power, double _gain, bool _visualize=true)
 Spawn an Wireless transmitter sensor on a link. More...
 
virtual void TearDown ()
 Tear down the test fixture. This gets called by gtest. More...
 
virtual void Unload ()
 Unload the test fixture. More...
 
void WaitUntilEntitySpawn (const std::string &_name, unsigned int _sleepEach, int _retries)
 Wait for a number of ms. More...
 
void WaitUntilIteration (const uint32_t _goalIteration, const int _sleepEach, const int _retries) const
 Wait for a number of ms. More...
 
void WaitUntilSensorSpawn (const std::string &_name, unsigned int _sleepEach, int _retries)
 Wait for a number of ms. More...
 
void WaitUntilSimTime (const common::Time &_goalTime, const int _ms, const int _maxRetries) const
 Wait for a number of ms. More...
 

Static Protected Member Functions

template<typename T >
static void CheckPointer (boost::shared_ptr< T > _ptr)
 Check that a pointer is not NULL. More...
 

Protected Attributes

transport::PublisherPtr factoryPub
 Factory publisher. More...
 
transport::NodePtr node
 Pointer to a node for communication. More...
 
common::Time pauseTime
 
std::map< std::string, ignition::math::Pose3d > poses
 Map of received poses. More...
 
transport::SubscriberPtr poseSub
 Pose subscription. More...
 
common::Time realTime
 
std::mutex receiveMutex
 Mutex to protect data structures that store messages. More...
 
transport::PublisherPtr requestPub
 Request publisher. More...
 
Serverserver
 Pointer the Gazebo server. More...
 
boost::thread * serverThread
 Pointer the thread the runs the server. More...
 
common::Time simTime
 Current simulation time, real time, and pause time. More...
 
transport::SubscriberPtr statsSub
 World statistics subscription. More...
 

Member Function Documentation

static void CheckPointer ( boost::shared_ptr< T >  _ptr)
inlinestaticprotectedinherited

Check that a pointer is not NULL.

A function is created for this purpose, since ASSERT's cannot be called from non-void functions.

Parameters
[in]_ptrPointer to verify is not NULL.

References NULL.

void DoubleCompare ( double *  _scanA,
double *  _scanB,
unsigned int  _sampleCount,
double &  _diffMax,
double &  _diffSum,
double &  _diffAvg 
)
protectedinherited

Function to compare two double arrays (for example two laser scans).

Parameters
[in]_scanAFirst double array.
[in]_scanBSecond double array.
[in]_sampleCountNumber of samples in each double array.
[out]_diffMaxMaximum difference between the two arrays.
[out]_diffSumSum of the differences between the two arrays.
[out]_diffAvgAverage difference between the two arrays.
ignition::math::Pose3d EntityPose ( const std::string &  _name)
protectedinherited

Get the pose of an entity.

Parameters
[in]_nameName of the entity.
Returns
Pose of the named entity.
void FloatCompare ( float *  _scanA,
float *  _scanB,
unsigned int  _sampleCount,
float &  _diffMax,
float &  _diffSum,
float &  _diffAvg 
)
protectedinherited

Function to compare two float arrays (for example two laser scans).

Parameters
[in]_scanAFirst float array.
[in]_scanBSecond float array.
[in]_sampleCountNumber of samples in each float array.
[out]_diffMaxMaximum difference between the two arrays.
[out]_diffSumSum of the differences between the two arrays.
[out]_diffAvgAverage difference between the two arrays.
math::Pose GetEntityPose ( const std::string &  _name)
protectedinherited

Get the pose of an entity.

Parameters
[in]_nameName of the entity.
Returns
Pose of the named entity.
Deprecated:
See ignition::math::Pose3d EntityPose( const std::string &_name)
void GetFrame ( const std::string &  _cameraName,
unsigned char **  _imgData,
unsigned int &  _width,
unsigned int &  _height 
)
protectedinherited

Get an image frame from a camera.

Parameters
[in]_cameraNameName of the camera to get a frame from.
[out]_imgDataArray that receives the image data.
[in]_widthWidth of the image frame.
[in]_heightHeight of the image frame.
void GetMemInfo ( double &  _resident,
double &  _share 
)
protectedinherited

Get the current memory information.

Parameters
[out]_residentResident memory.
[out]_shareShared memory.
physics::ModelPtr GetModel ( const std::string &  _name)
protectedinherited

Get a pointer to a model.

Parameters
[in]_nameName of the model to get.
Returns
Pointer to the model, or NULL if the model was not found.
double GetPercentRealTime ( ) const
protectedinherited

Get the real-time factor.

Returns
The percent real time simulation is running.
rendering::ScenePtr GetScene ( const std::string &  _sceneName = "default")
protectedinherited

Get a pointer to the rendering scene.

Parameters
[in]_sceneNameName of the scene to get.
std::string GetUniqueString ( const std::string &  _prefix)
protectedinherited

Get unique string with a specified prefix.

Parameters
[in]_prefixPrefix for unique string.
Returns
String with prefix and unique number as suffix.
bool HasEntity ( const std::string &  _name)
protectedinherited

Return true if the named entity exists.

Parameters
[in]_nameName of the entity to check for.
Returns
True if the entity exists.
void ImageCompare ( unsigned char *  _imageA,
unsigned char *  _imageB,
unsigned int  _width,
unsigned int  _height,
unsigned int  _depth,
unsigned int &  _diffMax,
unsigned int &  _diffSum,
double &  _diffAvg 
)
protectedinherited

Function to compare two images.

Parameters
[in]_imageAFirst image to compare.
[in]_imageBSecond image to compare.
[in]_widthWidth of both images.
[in]_heightHeight of both images.
[in]_depthDepth of both images.
[out]_diffMaxMaximum difference between the two arrays.
[out]_diffSumSum of the differences between the two arrays.
[out]_diffAvgAverage difference between the two arrays.
virtual void Load ( const std::string &  _worldFilename)
protectedvirtualinherited

Load a world based on a filename.

Parameters
[in]_worldFilenameName of the world to load.
virtual void Load ( const std::string &  _worldFilename,
bool  _paused 
)
protectedvirtualinherited

Load a world based on a filename and set simulation paused/un-paused.

Parameters
[in]_worldFilenameName of the world to load.
[in]_pausedTrue to start the world paused.
virtual void Load ( const std::string &  _worldFilename,
bool  _paused,
const std::string &  _physics,
const std::vector< std::string > &  _systemPlugins = {} 
)
protectedvirtualinherited

Load a world based on a filename and set simulation paused/un-paused, and specify physics engine.

This versions allows plugins to be loaded (via the cmd line args)

Parameters
[in]_worldFilenameName of the world to load.
[in]_pausedTrue to start the world paused.
[in]_physicsName of the physics engine.
[in]_systemPluginsArray of system plugins to load.
virtual void LoadArgs ( const std::string &  _args)
protectedvirtualinherited

Load a world in gzserver.

Parameters
[in]_argsOptions for the server using the same syntax used in the command line. E.g.: "-u --verbose" will run gzserver paused and in verbose mode.
void LoadPlugin ( const std::string &  _filename,
const std::string &  _name 
)
protectedinherited

Load a plugin.

Parameters
[in]_filenamePlugin filename to load.
[in]_nameName to associate with with the plugin.
void OnPose ( ConstPosesStampedPtr &  _msg)
protectedinherited

Function that received poses messages from a running simulation.

Parameters
[in]_msgPose message.
void OnStats ( ConstWorldStatisticsPtr &  _msg)
protectedinherited

Function that received world stastics messages.

Parameters
[in]_msgWorld statistics message.
void PrintImage ( const std::string &  _name,
unsigned char **  _image,
unsigned int  _width,
unsigned int  _height,
unsigned int  _depth 
)
protectedinherited

Print image data to screen.

This is used to generate test data.

Parameters
[in]_nameName to associate with the printed data.
[in]_imageThe raw image data.
[in]_widthWidth of the image.
[in]_heightHeight of the image.
[in]_depthPixel depth.
void PrintScan ( const std::string &  _name,
double *  _scan,
unsigned int  _sampleCount 
)
protectedinherited

Print laser scan to screen.

This is used to generate test data.

Parameters
[in]_nameName to associate with the printed data.
[in]_scanThe laser scan data.
[in]_sampleCountNumber of samples in the scan data.
void Record ( const std::string &  _name,
const double  _data 
)
protectedinherited

Helper to record data to gtest xml output.

Parameters
[in]_nameName of data.
[in]_dataFloating point number to store.
void Record ( const std::string &  _prefix,
const ignition::math::SignalStats &  _stats 
)
protectedinherited

Helper to record signal statistics to gtest xml output.

Parameters
[in]_prefixPrefix string for data names.
[in]_statsSignal statistics to store.
void Record ( const std::string &  _prefix,
const ignition::math::Vector3Stats &  _stats 
)
protectedinherited

Helper to record Vector3d signal statistics to gtest xml output.

Parameters
[in]_prefixPrefix string for data names.
[in]_statsVector3d signal statistics to store.
void RemoveModel ( const std::string &  _name)
protectedinherited

Remove a model by name.

Parameters
[in]_nameName of the model to remove.
void RemovePlugin ( const std::string &  _name)
protectedinherited

Remove a plugin.

Parameters
[in]_nameName of the plugin to remove.
void RunServer ( const std::vector< std::string > &  _args)
protectedinherited

Run the server.

Parameters
[in]_argsVector of options for the server using the same syntax used in the command line. E.g.: {"-u", "--verbose"} will run gzserver paused and in verbose mode.
void SetPause ( bool  _pause)
protectedinherited

Set a running simulation paused/unpaused.

virtual void SetUp ( )
virtual
void SpawnBox ( const std::string &  _name,
const math::Vector3 _size,
const math::Vector3 _pos,
const math::Vector3 _rpy,
bool  _static = false 
)
inlineprotectedinherited

Spawn a box.

Parameters
[in]_nameName for the model.
[in]_sizeSize of the box.
[in]_posPosition for the model.
[in]_rpyRoll, pitch, yaw for the model.
[in]_staticTrue to make the model static.
Deprecated:
See function that accepts ignition::math parameters

References Vector3::Ign().

void SpawnBox ( const std::string &  _name,
const ignition::math::Vector3d &  _size = ignition::math::Vector3d::One,
const ignition::math::Vector3d &  _pos = ignition::math::Vector3d::Zero,
const ignition::math::Vector3d &  _rpy = ignition::math::Vector3d::Zero,
bool  _static = false 
)
protectedinherited

Spawn a box.

Parameters
[in]_nameName for the model.
[in]_sizeSize of the box.
[in]_posPosition for the model.
[in]_rpyRoll, pitch, yaw for the model.
[in]_staticTrue to make the model static.
void SpawnCamera ( const std::string &  _modelName,
const std::string &  _cameraName,
const math::Vector3 _pos,
const math::Vector3 _rpy,
unsigned int  _width = 320,
unsigned int  _height = 240,
double  _rate = 25,
const std::string &  _noiseType = "",
double  _noiseMean = 0.0,
double  _noiseStdDev = 0.0,
bool  _distortion = false,
double  _distortionK1 = 0.0,
double  _distortionK2 = 0.0,
double  _distortionK3 = 0.0,
double  _distortionP1 = 0.0,
double  _distortionP2 = 0.0,
double  _cx = 0.5,
double  _cy = 0.5 
)
inlineprotectedinherited

Spawn a camera.

Parameters
[in]_modelNameName of the model.
[in]_cameraNameName of the camera.
[in]_posCamera position.
[in]_rpyCamera roll, pitch, yaw.
[in]_widthOutput image width.
[in]_heightOutput image height.
[in]_rateOutput Hz.
[in]_noiseTypeType of noise to apply.
[in]_noiseMeanMean noise value.
[in]_noiseStdDevStandard deviation of the noise.
[in]_distortionK1Distortion coefficient k1.
[in]_distortionK2Distortion coefficient k2.
[in]_distortionK3Distortion coefficient k3.
[in]_distortionP1Distortion coefficient P1.
[in]_distortionP2Distortion coefficient p2.
[in]_cxNormalized optical center x, used for distortion.
[in]_cyNormalized optical center y, used for distortion.
Deprecated:
See function that accepts ignition::math parameters

References Vector3::Ign().

void SpawnCamera ( const std::string &  _modelName,
const std::string &  _cameraName,
const ignition::math::Vector3d &  _pos = ignition::math::Vector3d::Zero,
const ignition::math::Vector3d &  _rpy = ignition::math::Vector3d::Zero,
unsigned int  _width = 320,
unsigned int  _height = 240,
double  _rate = 25,
const std::string &  _noiseType = "",
double  _noiseMean = 0.0,
double  _noiseStdDev = 0.0,
bool  _distortion = false,
double  _distortionK1 = 0.0,
double  _distortionK2 = 0.0,
double  _distortionK3 = 0.0,
double  _distortionP1 = 0.0,
double  _distortionP2 = 0.0,
double  _cx = 0.5,
double  _cy = 0.5 
)
protectedinherited

Spawn a camera.

Parameters
[in]_modelNameName of the model.
[in]_cameraNameName of the camera.
[in]_posCamera position.
[in]_rpyCamera roll, pitch, yaw.
[in]_widthOutput image width.
[in]_heightOutput image height.
[in]_rateOutput Hz.
[in]_noiseTypeType of noise to apply.
[in]_noiseMeanMean noise value.
[in]_noiseStdDevStandard deviation of the noise.
[in]_distortionK1Distortion coefficient k1.
[in]_distortionK2Distortion coefficient k2.
[in]_distortionK3Distortion coefficient k3.
[in]_distortionP1Distortion coefficient P1.
[in]_distortionP2Distortion coefficient p2.
[in]_cxNormalized optical center x, used for distortion.
[in]_cyNormalized optical center y, used for distortion.
void SpawnCylinder ( const std::string &  _name,
const math::Vector3 _pos,
const math::Vector3 _rpy,
bool  _static = false 
)
inlineprotectedinherited

Spawn a cylinder.

Parameters
[in]_nameName for the model.
[in]_posPosition for the model.
[in]_rpyRoll, pitch, yaw for the model.
[in]_staticTrue to make the model static.
Deprecated:
See function that accepts ignition::math parameters

References Vector3::Ign().

void SpawnCylinder ( const std::string &  _name,
const ignition::math::Vector3d &  _pos = ignition::math::Vector3d::Zero,
const ignition::math::Vector3d &  _rpy = ignition::math::Vector3d::Zero,
bool  _static = false 
)
protectedinherited

Spawn a cylinder.

Parameters
[in]_nameName for the model.
[in]_posPosition for the model.
[in]_rpyRoll, pitch, yaw for the model.
[in]_staticTrue to make the model static.
void SpawnDepthCameraSensor ( const std::string &  _modelName,
const std::string &  _cameraName,
const ignition::math::Vector3d &  _pos = ignition::math::Vector3d::Zero,
const ignition::math::Vector3d &  _rpy = ignition::math::Vector3d::Zero,
const unsigned int  _width = 320,
const unsigned int  _height = 240,
const double  _rate = 25,
const double  _near = 0.1,
const double  _far = 10 
)
protectedinherited

Spawn a depth camera.

Parameters
[in]_modelNameName of the model.
[in]_cameraNameName of the camera.
[in]_posCamera position.
[in]_rpyCamera roll, pitch, yaw.
[in]_widthOutput image width.
[in]_heightOutput image height.
[in]_rateOutput Hz.
[in]_nearNear clipping distance
[in]_farFar clipping distance
void SpawnEmptyLink ( const std::string &  _name,
const math::Vector3 _pos,
const math::Vector3 _rpy,
bool  _static = false 
)
inlineprotectedinherited

Spawn an empty link.

Parameters
[in]_nameName for the model.
[in]_posPosition for the model.
[in]_rpyRoll, pitch, yaw for the model.
[in]_staticTrue to make the model static.
Deprecated:
See function that accepts ignition::math parameters

References Vector3::Ign().

void SpawnEmptyLink ( const std::string &  _name,
const ignition::math::Vector3d &  _pos = ignition::math::Vector3d::Zero,
const ignition::math::Vector3d &  _rpy = ignition::math::Vector3d::Zero,
bool  _static = false 
)
protectedinherited

Spawn an empty link.

Parameters
[in]_nameName for the model.
[in]_posPosition for the model.
[in]_rpyRoll, pitch, yaw for the model.
[in]_staticTrue to make the model static.
void SpawnGpuRaySensor ( const std::string &  _modelName,
const std::string &  _raySensorName,
const math::Vector3 _pos,
const math::Vector3 _rpy,
double  _hMinAngle = -2.0,
double  _hMaxAngle = 2.0,
double  _minRange = 0.08,
double  _maxRange = 10,
double  _rangeResolution = 0.01,
unsigned int  _samples = 640,
const std::string &  _noiseType = "",
double  _noiseMean = 0.0,
double  _noiseStdDev = 0.0 
)
inlineprotectedinherited

Spawn a gpu laser.

Parameters
[in]_modelNameName of the model.
[in]_raySensorNameName of the laser.
[in]_posCamera position.
[in]_rpyCamera roll, pitch, yaw.
[in]_hMinAngleHorizontal min angle
[in]_hMaxAngleHorizontal max angle
[in]_minRangeMin range
[in]_maxRangeMax range
[in]_rangeResolutionResolution of the scan
[in]_samplesNumber of samples.
[in]_rateOutput Hz.
[in]_noiseTypeType of noise to apply.
[in]_noiseMeanMean noise value.
[in]_noiseStdDevStandard deviation of the noise.
Deprecated:
See function that accepts ignition::math parameters

References Vector3::Ign().

void SpawnGpuRaySensor ( const std::string &  _modelName,
const std::string &  _raySensorName,
const ignition::math::Vector3d &  _pos = ignition::math::Vector3d::Zero,
const ignition::math::Vector3d &  _rpy = ignition::math::Vector3d::Zero,
double  _hMinAngle = -2.0,
double  _hMaxAngle = 2.0,
double  _minRange = 0.08,
double  _maxRange = 10,
double  _rangeResolution = 0.01,
unsigned int  _samples = 640,
const std::string &  _noiseType = "",
double  _noiseMean = 0.0,
double  _noiseStdDev = 0.0 
)
protectedinherited

Spawn a gpu laser.

Parameters
[in]_modelNameName of the model.
[in]_raySensorNameName of the laser.
[in]_posCamera position.
[in]_rpyCamera roll, pitch, yaw.
[in]_hMinAngleHorizontal min angle
[in]_hMaxAngleHorizontal max angle
[in]_minRangeMin range
[in]_maxRangeMax range
[in]_rangeResolutionResolution of the scan
[in]_samplesNumber of samples.
[in]_rateOutput Hz.
[in]_noiseTypeType of noise to apply.
[in]_noiseMeanMean noise value.
[in]_noiseStdDevStandard deviation of the noise.
void SpawnImuSensor ( const std::string &  _modelName,
const std::string &  _imuSensorName,
const math::Vector3 _pos,
const math::Vector3 _rpy,
const std::string &  _noiseType = "",
double  _rateNoiseMean = 0.0,
double  _rateNoiseStdDev = 0.0,
double  _rateBiasMean = 0.0,
double  _rateBiasStdDev = 0.0,
double  _accelNoiseMean = 0.0,
double  _accelNoiseStdDev = 0.0,
double  _accelBiasMean = 0.0,
double  _accelBiasStdDev = 0.0 
)
inlineprotectedinherited

Spawn an imu sensor laser.

Parameters
[in]_modelNameName of the model.
[in]_imuSensorNameName of the imu sensor.
[in]_posCamera position.
[in]_rpyCamera roll, pitch, yaw.
[in]_noiseTypeType of noise to apply.
[in]_noiseMeanMean noise value.
[in]_noiseStdDevStandard deviation of the noise.
[in]_accelNoiseMeanAcceleration based noise mean.
[in]_accelNoiseStdDevAcceleration based noise standard deviation.
[in]_accelBiasMeanAcceleration mean bias
[in]_accelBiasStdDevAcceleration standard deviation bias
Deprecated:
See function that accepts ignition::math parameters

References Vector3::Ign().

void SpawnImuSensor ( const std::string &  _modelName,
const std::string &  _imuSensorName,
const ignition::math::Vector3d &  _pos = ignition::math::Vector3d::Zero,
const ignition::math::Vector3d &  _rpy = ignition::math::Vector3d::Zero,
const std::string &  _noiseType = "",
double  _rateNoiseMean = 0.0,
double  _rateNoiseStdDev = 0.0,
double  _rateBiasMean = 0.0,
double  _rateBiasStdDev = 0.0,
double  _accelNoiseMean = 0.0,
double  _accelNoiseStdDev = 0.0,
double  _accelBiasMean = 0.0,
double  _accelBiasStdDev = 0.0 
)
protectedinherited

Spawn an imu sensor laser.

Parameters
[in]_modelNameName of the model.
[in]_imuSensorNameName of the imu sensor.
[in]_posCamera position.
[in]_rpyCamera roll, pitch, yaw.
[in]_noiseTypeType of noise to apply.
[in]_noiseMeanMean noise value.
[in]_noiseStdDevStandard deviation of the noise.
[in]_accelNoiseMeanAcceleration based noise mean.
[in]_accelNoiseStdDevAcceleration based noise standard deviation.
[in]_accelBiasMeanAcceleration mean bias
[in]_accelBiasStdDevAcceleration standard deviation bias
void SpawnLight ( const std::string &  _name,
const std::string &  _type,
const math::Vector3 _pos,
const math::Vector3 _rpy,
const common::Color _diffuse = common::Color::White,
const common::Color _specular = common::Color::White,
const math::Vector3 _direction = -math::Vector3::UnitZ,
double  _attenuationRange = 20,
double  _attenuationConstant = 0.5,
double  _attenuationLinear = 0.01,
double  _attenuationQuadratic = 0.001,
double  _spotInnerAngle = 0,
double  _spotOuterAngle = 0,
double  _spotFallOff = 0,
bool  _castShadows = true 
)
inlineprotectedinherited

Spawn a light.

Parameters
[in]_nameName for the light.
[in]_sizeType of light - "spot", "directional", or "point".
[in]_posPosition for the light.
[in]_rpyRoll, pitch, yaw for the light.
[in]_diffuseDiffuse color of the light.
[in]_specularSpecular color of the light.
[in]_directionDirection of the light ("spot" and "directional").
[in]_attenuationRangeRange of attenuation.
[in]_attenuationConstantConstant component of attenuation
[in]_attenuationLinearLinear component of attenuation
[in]_attenuationQuadraticQuadratic component of attenuation
[in]_spotInnerAngleInner angle ("spot" only).
[in]_spotOuterAngleOuter angle ("spot" only).
[in]_spotFallOffFall off ("spot" only).
[in]_castShadowsTrue to cast shadows.
Deprecated:
See function that accepts ignition::math parameters

References Vector3::Ign(), and Color::White.

void SpawnLight ( const std::string &  _name,
const std::string &  _type,
const ignition::math::Vector3d &  _pos = ignition::math::Vector3d::Zero,
const ignition::math::Vector3d &  _rpy = ignition::math::Vector3d::Zero,
const common::Color _diffuse = common::Color::White,
const common::Color _specular = common::Color::White,
const ignition::math::Vector3d &  _direction = -ignition::math::Vector3d::UnitZ,
double  _attenuationRange = 20,
double  _attenuationConstant = 0.5,
double  _attenuationLinear = 0.01,
double  _attenuationQuadratic = 0.001,
double  _spotInnerAngle = 0,
double  _spotOuterAngle = 0,
double  _spotFallOff = 0,
bool  _castShadows = true 
)
protectedinherited

Spawn a light.

Parameters
[in]_nameName for the light.
[in]_sizeType of light - "spot", "directional", or "point".
[in]_posPosition for the light.
[in]_rpyRoll, pitch, yaw for the light.
[in]_diffuseDiffuse color of the light.
[in]_specularSpecular color of the light.
[in]_directionDirection of the light ("spot" and "directional").
[in]_attenuationRangeRange of attenuation.
[in]_attenuationConstantConstant component of attenuation
[in]_attenuationLinearLinear component of attenuation
[in]_attenuationQuadraticQuadratic component of attenuation
[in]_spotInnerAngleInner angle ("spot" only).
[in]_spotOuterAngleOuter angle ("spot" only).
[in]_spotFallOffFall off ("spot" only).
[in]_castShadowsTrue to cast shadows.
physics::ModelPtr SpawnModel ( const msgs::Model &  _msg)
protectedinherited

Spawn a model from a msgs::Model and return ModelPtr.

Parameters
[in]_msgModel message.
Returns
Pointer to model.
void SpawnModel ( const std::string &  _filename)
protectedinherited

Spawn a model from file.

Parameters
[in]_filenameFile to load a model from.
void SpawnRaySensor ( const std::string &  _modelName,
const std::string &  _raySensorName,
const math::Vector3 _pos,
const math::Vector3 _rpy,
double  _hMinAngle = -2.0,
double  _hMaxAngle = 2.0,
double  _vMinAngle = -1.0,
double  _vMaxAngle = 1.0,
double  _minRange = 0.08,
double  _maxRange = 10,
double  _rangeResolution = 0.01,
unsigned int  _samples = 640,
unsigned int  _vSamples = 1,
double  _hResolution = 1.0,
double  _vResolution = 1.0,
const std::string &  _noiseType = "",
double  _noiseMean = 0.0,
double  _noiseStdDev = 0.0 
)
inlineprotectedinherited

Spawn a laser.

Parameters
[in]_modelNameName of the model.
[in]_raySensorNameName of the laser.
[in]_posCamera position.
[in]_rpyCamera roll, pitch, yaw.
[in]_hMinAngleHorizontal min angle
[in]_hMaxAngleHorizontal max angle
[in]_minRangeMin range
[in]_maxRangeMax range
[in]_rangeResolutionResolution of the scan
[in]_samplesNumber of samples.
[in]_rateOutput Hz.
[in]_noiseTypeType of noise to apply.
[in]_noiseMeanMean noise value.
[in]_noiseStdDevStandard deviation of the noise.
Deprecated:
See function that accepts ignition::math parameters

References Vector3::Ign().

void SpawnRaySensor ( const std::string &  _modelName,
const std::string &  _raySensorName,
const ignition::math::Vector3d &  _pos = ignition::math::Vector3d::Zero,
const ignition::math::Vector3d &  _rpy = ignition::math::Vector3d::Zero,
double  _hMinAngle = -2.0,
double  _hMaxAngle = 2.0,
double  _vMinAngle = -1.0,
double  _vMaxAngle = 1.0,
double  _minRange = 0.08,
double  _maxRange = 10,
double  _rangeResolution = 0.01,
unsigned int  _samples = 640,
unsigned int  _vSamples = 1,
double  _hResolution = 1.0,
double  _vResolution = 1.0,
const std::string &  _noiseType = "",
double  _noiseMean = 0.0,
double  _noiseStdDev = 0.0 
)
protectedinherited

Spawn a laser.

Parameters
[in]_modelNameName of the model.
[in]_raySensorNameName of the laser.
[in]_posCamera position.
[in]_rpyCamera roll, pitch, yaw.
[in]_hMinAngleHorizontal min angle
[in]_hMaxAngleHorizontal max angle
[in]_minRangeMin range
[in]_maxRangeMax range
[in]_rangeResolutionResolution of the scan
[in]_samplesNumber of samples.
[in]_rateOutput Hz.
[in]_noiseTypeType of noise to apply.
[in]_noiseMeanMean noise value.
[in]_noiseStdDevStandard deviation of the noise.
void SpawnSDF ( const std::string &  _sdf)
protectedinherited

Send a factory message based on an SDF string.

Parameters
[in]_sdfSDF string to publish.
sensors::SonarSensorPtr SpawnSonar ( const std::string &  _modelName,
const std::string &  _sonarName,
const ignition::math::Pose3d &  _pose,
const double  _minRange,
const double  _maxRange,
const double  _radius 
)
protectedinherited

Spawn a sonar.

Parameters
[in]_modelNameName of the model.
[in]_sonarNameName of the sonar.
[in]_poseSonar pose.
[in]_minRangeMinimum sonar range.
[in]_maxRangeMaximum sonar range.
[in]_radiusSonar cone radius.
void SpawnSphere ( const std::string &  _name,
const math::Vector3 _pos,
const math::Vector3 _rpy,
bool  _wait = true,
bool  _static = false 
)
inlineprotectedinherited

Spawn a sphere.

Parameters
[in]_nameName for the model.
[in]_posPosition for the model.
[in]_rpyRoll, pitch, yaw for the model.
[in]_staticTrue to make the model static.
[in]_waitTrue to wait for the sphere to spawn before returning.
Deprecated:
See function that accepts ignition::math parameters

References Vector3::Ign().

void SpawnSphere ( const std::string &  _name,
const ignition::math::Vector3d &  _pos,
const ignition::math::Vector3d &  _rpy,
bool  _wait = true,
bool  _static = false 
)
protectedinherited

Spawn a sphere.

Parameters
[in]_nameName for the model.
[in]_posPosition for the model.
[in]_rpyRoll, pitch, yaw for the model.
[in]_staticTrue to make the model static.
[in]_waitTrue to wait for the sphere to spawn before returning.
void SpawnSphere ( const std::string &  _name,
const math::Vector3 _pos,
const math::Vector3 _rpy,
const math::Vector3 _cog,
double  _radius,
bool  _wait = true,
bool  _static = false 
)
inlineprotectedinherited

Spawn a sphere.

Parameters
[in]_nameName for the model.
[in]_posPosition for the model.
[in]_rpyRoll, pitch, yaw for the model.
[in]_cogCenter of gravity.
[in]_radiusSphere radius.
[in]_staticTrue to make the model static.
[in]_waitTrue to wait for the sphere to spawn before returning.
Deprecated:
See function that accepts ignition::math parameters

References Vector3::Ign().

void SpawnSphere ( const std::string &  _name,
const ignition::math::Vector3d &  _pos,
const ignition::math::Vector3d &  _rpy,
const ignition::math::Vector3d &  _cog,
double  _radius = 1.0,
bool  _wait = true,
bool  _static = false 
)
protectedinherited

Spawn a sphere.

Parameters
[in]_nameName for the model.
[in]_posPosition for the model.
[in]_rpyRoll, pitch, yaw for the model.
[in]_cogCenter of gravity.
[in]_radiusSphere radius.
[in]_staticTrue to make the model static.
[in]_waitTrue to wait for the sphere to spawn before returning.
void SpawnTrimesh ( const std::string &  _name,
const std::string &  _modelPath,
const math::Vector3 _scale,
const math::Vector3 _pos,
const math::Vector3 _rpy,
bool  _static = false 
)
inlineprotectedinherited

Spawn a triangle mesh.

Parameters
[in]_nameName for the model.
[in]_modelPathPath to the mesh file.
[in]_scaleScaling factor.
[in]_posPosition for the model.
[in]_rpyRoll, pitch, yaw for the model.
[in]_staticTrue to make the model static.
Deprecated:
See function that accepts ignition::math parameters

References Vector3::Ign().

void SpawnTrimesh ( const std::string &  _name,
const std::string &  _modelPath,
const ignition::math::Vector3d &  _scale = ignition::math::Vector3d::One,
const ignition::math::Vector3d &  _pos = ignition::math::Vector3d::Zero,
const ignition::math::Vector3d &  _rpy = ignition::math::Vector3d::Zero,
bool  _static = false 
)
protectedinherited

Spawn a triangle mesh.

Parameters
[in]_nameName for the model.
[in]_modelPathPath to the mesh file.
[in]_scaleScaling factor.
[in]_posPosition for the model.
[in]_rpyRoll, pitch, yaw for the model.
[in]_staticTrue to make the model static.
void SpawnUnitAltimeterSensor ( const std::string &  _name,
const std::string &  _sensorName,
const std::string &  _collisionType,
const std::string &  _topic,
const ignition::math::Vector3d &  _pos = ignition::math::Vector3d::Zero,
const ignition::math::Vector3d &  _rpy = ignition::math::Vector3d::Zero,
bool  _static = false 
)
protectedinherited

Spawn an altimeter sensor on a link.

Parameters
[in]_nameModel name
[in]_sensorNameSensor name
[in]_collisionTypeType of collision, box or cylinder
[in]_topicTopic to publish altimeter data to
[in]_posWorld position
[in]_rpyWorld rotation in Euler angles
[in]_staticTrue to make the model static
void SpawnUnitContactSensor ( const std::string &  _name,
const std::string &  _sensorName,
const std::string &  _collisionType,
const math::Vector3 _pos,
const math::Vector3 _rpy,
bool  _static = false 
)
inlineprotectedinherited

Spawn a contact sensor with the specified collision geometry.

Parameters
[in]_nameModel name
[in]_sensorNameSensor name
[in]_collisionTypeType of collision, box or cylinder
[in]_posWorld position
[in]_rpyWorld rotation in Euler angles
[in]_staticTrue to make the model static
Deprecated:
See function that accepts ignition::math parameters

References Vector3::Ign().

void SpawnUnitContactSensor ( const std::string &  _name,
const std::string &  _sensorName,
const std::string &  _collisionType,
const ignition::math::Vector3d &  _pos = ignition::math::Vector3d::Zero,
const ignition::math::Vector3d &  _rpy = ignition::math::Vector3d::Zero,
bool  _static = false 
)
protectedinherited

Spawn a contact sensor with the specified collision geometry.

Parameters
[in]_nameModel name
[in]_sensorNameSensor name
[in]_collisionTypeType of collision, box or cylinder
[in]_posWorld position
[in]_rpyWorld rotation in Euler angles
[in]_staticTrue to make the model static
void SpawnUnitImuSensor ( const std::string &  _name,
const std::string &  _sensorName,
const std::string &  _collisionType,
const std::string &  _topic,
const math::Vector3 _pos,
const math::Vector3 _rpy,
bool  _static = false 
)
inlineprotectedinherited

Spawn an IMU sensor on a link.

Parameters
[in]_nameModel name
[in]_sensorNameSensor name
[in]_collisionTypeType of collision, box or cylinder
[in]_topicTopic to publish IMU data to
[in]_posWorld position
[in]_rpyWorld rotation in Euler angles
[in]_staticTrue to make the model static
Deprecated:
See function that accepts ignition::math parameters

References Vector3::Ign().

void SpawnUnitImuSensor ( const std::string &  _name,
const std::string &  _sensorName,
const std::string &  _collisionType,
const std::string &  _topic,
const ignition::math::Vector3d &  _pos = ignition::math::Vector3d::Zero,
const ignition::math::Vector3d &  _rpy = ignition::math::Vector3d::Zero,
bool  _static = false 
)
protectedinherited

Spawn an IMU sensor on a link.

Parameters
[in]_nameModel name
[in]_sensorNameSensor name
[in]_collisionTypeType of collision, box or cylinder
[in]_topicTopic to publish IMU data to
[in]_posWorld position
[in]_rpyWorld rotation in Euler angles
[in]_staticTrue to make the model static
void SpawnUnitMagnetometerSensor ( const std::string &  _name,
const std::string &  _sensorName,
const std::string &  _collisionType,
const std::string &  _topic,
const ignition::math::Vector3d &  _pos = ignition::math::Vector3d::Zero,
const ignition::math::Vector3d &  _rpy = ignition::math::Vector3d::Zero,
bool  _static = false 
)
protectedinherited

Spawn a magnetometer sensor on a link.

Parameters
[in]_nameModel name
[in]_sensorNameSensor name
[in]_collisionTypeType of collision, box or cylinder
[in]_topicTopic to publish magnetometer data to
[in]_posWorld position
[in]_rpyWorld rotation in Euler angles
[in]_staticTrue to make the model static
void SpawnWideAngleCamera ( const std::string &  _modelName,
const std::string &  _cameraName,
const ignition::math::Vector3d &  _pos = ignition::math::Vector3d::Zero,
const ignition::math::Vector3d &  _rpy = ignition::math::Vector3d::Zero,
unsigned int  _width = 320,
unsigned int  _height = 240,
double  _rate = 25,
const double  _hfov = 60,
const std::string &  _lensType = "stereographic",
const bool  _scaleToHfov = true,
const double  _cutoffAngle = 3.1415,
const double  _envTextureSize = 512,
const double  _c1 = 1.05,
const double  _c2 = 4,
const double  _f = 1.0,
const std::string &  _fun = "tan" 
)
protectedinherited

Spawn a wide angle camera.

Parameters
[in]_modelNameName of the model.
[in]_cameraNameName of the camera.
[in]_posCamera position.
[in]_rpyCamera roll, pitch, yaw.
[in]_widthOutput image width.
[in]_heightOutput image height.
[in]_rateOutput Hz.
[in]_hfovHorizontal field of view.
[in]_lensTypeType of lens: gnomonical, stereographic, equidistant, equisolid_angle, or orthographic.
[in]_scaleToHfovTrue to use horizontal field of view as defined, otherwise it depends on lens type and custom function.
[in]_cutoffAngleClip everything outside this angle
[in]_envTextureSizeCubemap environment texture size.
[in]_c1For "custom" lens type, the c1 coefficient used in the mapping function
[in]_c2For "custom" lens type, the c2 coefficient used in the mapping function
[in]_fFor "custom" lens type, the focal length used in the mapping function
[in]_funFor "custom" lens type, the trigonometirc function used in the mapping function
void SpawnWirelessReceiverSensor ( const std::string &  _name,
const std::string &  _sensorName,
const math::Vector3 _pos,
const math::Vector3 _rpy,
double  _minFreq,
double  _maxFreq,
double  _power,
double  _gain,
double  _sensitivity,
bool  _visualize = true 
)
inlineprotectedinherited

Spawn an Wireless receiver sensor on a link.

Parameters
[in]_nameModel name
[in]_sensorNameSensor name
[in]_posWorld position
[in]_rpyWorld rotation in Euler angles
[in]_minFreqMinimum frequency to be filtered (MHz)
[in]_maxFreqMaximum frequency to be filtered (MHz)
[in]_powerTransmission power (dBm)
[in]_gainAntenna gain (dBi)
[in]_sensitivityReceiver sensitibity (dBm)
[in]_visualizeEnable sensor visualization
Deprecated:
See function that accepts ignition::math parameters

References Vector3::Ign().

void SpawnWirelessReceiverSensor ( const std::string &  _name,
const std::string &  _sensorName,
const ignition::math::Vector3d &  _pos,
const ignition::math::Vector3d &  _rpy,
double  _minFreq,
double  _maxFreq,
double  _power,
double  _gain,
double  _sensitivity,
bool  _visualize = true 
)
protectedinherited

Spawn an Wireless receiver sensor on a link.

Parameters
[in]_nameModel name
[in]_sensorNameSensor name
[in]_posWorld position
[in]_rpyWorld rotation in Euler angles
[in]_minFreqMinimum frequency to be filtered (MHz)
[in]_maxFreqMaximum frequency to be filtered (MHz)
[in]_powerTransmission power (dBm)
[in]_gainAntenna gain (dBi)
[in]_sensitivityReceiver sensitibity (dBm)
[in]_visualizeEnable sensor visualization
void SpawnWirelessTransmitterSensor ( const std::string &  _name,
const std::string &  _sensorName,
const math::Vector3 _pos,
const math::Vector3 _rpy,
const std::string &  _essid,
double  _freq,
double  _power,
double  _gain,
bool  _visualize = true 
)
inlineprotectedinherited

Spawn an Wireless transmitter sensor on a link.

Parameters
[in]_nameModel name
[in]_sensorNameSensor name
[in]_posWorld position
[in]_rpyWorld rotation in Euler angles
[in]_essidService set identifier (network name)
[in]_freqFrequency of transmission (MHz)
[in]_powerTransmission power (dBm)
[in]_gainAntenna gain (dBi)
[in]_visualizeEnable sensor visualization
Deprecated:
See function that accepts ignition::math parameters

References Vector3::Ign().

void SpawnWirelessTransmitterSensor ( const std::string &  _name,
const std::string &  _sensorName,
const ignition::math::Vector3d &  _pos,
const ignition::math::Vector3d &  _rpy,
const std::string &  _essid,
double  _freq,
double  _power,
double  _gain,
bool  _visualize = true 
)
protectedinherited

Spawn an Wireless transmitter sensor on a link.

Parameters
[in]_nameModel name
[in]_sensorNameSensor name
[in]_posWorld position
[in]_rpyWorld rotation in Euler angles
[in]_essidService set identifier (network name)
[in]_freqFrequency of transmission (MHz)
[in]_powerTransmission power (dBm)
[in]_gainAntenna gain (dBi)
[in]_visualizeEnable sensor visualization
virtual void TearDown ( )
protectedvirtualinherited

Tear down the test fixture. This gets called by gtest.

virtual void Unload ( )
protectedvirtual

Unload the test fixture.

Reimplemented from ServerFixture.

void WaitUntilEntitySpawn ( const std::string &  _name,
unsigned int  _sleepEach,
int  _retries 
)
protectedinherited

Wait for a number of ms.

and attempts until the entity is spawned

Parameters
[in]_nameModel name
[in]_sleepEachNumber of milliseconds to sleep in each iteration
[in]_retriesNumber of iterations until give up
void WaitUntilIteration ( const uint32_t  _goalIteration,
const int  _sleepEach,
const int  _retries 
) const
protectedinherited

Wait for a number of ms.

and attempts until the world reaches a target "iterations" value

Parameters
_goalIterationTarget iterations value
_sleepEachNumber of milliseconds to sleep in each iteration
_retriesNumber of iterations until give up
void WaitUntilSensorSpawn ( const std::string &  _name,
unsigned int  _sleepEach,
int  _retries 
)
protectedinherited

Wait for a number of ms.

and attempts until the sensor is spawned

Parameters
[in]_nameSensor name
[in]_sleepEachNumber of milliseconds to sleep in each iteration
[in]_retriesNumber of iterations until give up
void WaitUntilSimTime ( const common::Time _goalTime,
const int  _ms,
const int  _maxRetries 
) const
protectedinherited

Wait for a number of ms.

and attempts until the world reaches a target simulation time

Parameters
_goalTimeTarget simulation time.
_sleepEachNumber of milliseconds to sleep in each iteration
_retriesNumber of iterations until give up

Member Data Documentation

transport::PublisherPtr factoryPub
protectedinherited

Factory publisher.

transport::NodePtr node
protectedinherited

Pointer to a node for communication.

common::Time pauseTime
protectedinherited
std::map<std::string, ignition::math::Pose3d> poses
protectedinherited

Map of received poses.

transport::SubscriberPtr poseSub
protectedinherited

Pose subscription.

common::Time realTime
protectedinherited
std::mutex receiveMutex
protectedinherited

Mutex to protect data structures that store messages.

transport::PublisherPtr requestPub
protectedinherited

Request publisher.

Server* server
protectedinherited

Pointer the Gazebo server.

boost::thread* serverThread
protectedinherited

Pointer the thread the runs the server.

common::Time simTime
protectedinherited

Current simulation time, real time, and pause time.

transport::SubscriberPtr statsSub
protectedinherited

World statistics subscription.


The documentation for this class was generated from the following file: