17 #ifndef _GAZEBO_SERVER_FIXTURE_HH_ 18 #define _GAZEBO_SERVER_FIXTURE_HH_ 20 #pragma GCC diagnostic ignored "-Wswitch-default" 21 #pragma GCC diagnostic ignored "-Wfloat-equal" 22 #pragma GCC diagnostic ignored "-Wshadow" 26 # include <mach/mach.h> 31 #include <gtest/gtest.h> 32 #include <boost/thread.hpp> 34 #include <boost/filesystem.hpp> 40 #include <ignition/math/Pose3.hh> 41 #include <ignition/math/SignalStats.hh> 42 #include <ignition/math/Vector3Stats.hh> 44 #include "gazebo/transport/transport.hh" 52 #include "gazebo/sensors/sensors.hh" 53 #include "gazebo/rendering/rendering.hh" 56 #include "gazebo/gazebo_config.h" 60 #include "test_config.h" 78 protected:
virtual void Unload();
82 protected:
virtual void Load(
const std::string &_worldFilename);
88 protected:
virtual void Load(
const std::string &_worldFilename,
98 protected:
virtual void Load(
const std::string &_worldFilename,
99 bool _paused,
const std::string &_physics,
100 const std::vector<std::string> &_systemPlugins = {});
106 protected:
virtual void LoadArgs(
const std::string &_args);
112 protected:
void RunServer(
const std::vector<std::string> &_args);
117 const std::string &_sceneName =
"default");
121 protected:
void OnStats(ConstWorldStatisticsPtr &_msg);
124 protected:
void SetPause(
bool _pause);
133 protected:
void OnPose(ConstPosesStampedPtr &_msg);
139 const std::string &_name);
144 protected:
bool HasEntity(
const std::string &_name);
152 protected:
void PrintImage(
const std::string &_name,
unsigned char **_image,
153 unsigned int _width,
unsigned int _height,
154 unsigned int _depth);
160 protected:
void PrintScan(
const std::string &_name,
double *_scan,
161 unsigned int _sampleCount);
171 protected:
void FloatCompare(
float *_scanA,
float *_scanB,
172 unsigned int _sampleCount,
float &_diffMax,
173 float &_diffSum,
float &_diffAvg);
183 protected:
void DoubleCompare(
double *_scanA,
double *_scanB,
184 unsigned int _sampleCount,
double &_diffMax,
185 double &_diffSum,
double &_diffAvg);
197 unsigned char *_imageB,
198 unsigned int _width,
unsigned int _height,
200 unsigned int &_diffMax,
unsigned int &_diffSum,
209 private:
void OnNewFrame(
const unsigned char *_image,
210 unsigned int _width,
unsigned int _height,
212 const std::string &);
219 protected:
void GetFrame(
const std::string &_cameraName,
220 unsigned char **_imgData,
unsigned int &_width,
221 unsigned int &_height);
232 protected:
template<
typename T>
235 ASSERT_TRUE(_ptr !=
NULL);
257 protected:
void SpawnCamera(
const std::string &_modelName,
258 const std::string &_cameraName,
259 const ignition::math::Vector3d &_pos =
260 ignition::math::Vector3d::Zero,
261 const ignition::math::Vector3d &_rpy =
262 ignition::math::Vector3d::Zero,
263 unsigned int _width = 320,
unsigned int _height = 240,
265 const std::string &_noiseType =
"",
266 double _noiseMean = 0.0,
double _noiseStdDev = 0.0,
267 bool _distortion =
false,
double _distortionK1 = 0.0,
268 double _distortionK2 = 0.0,
double _distortionK3 = 0.0,
269 double _distortionP1 = 0.0,
double _distortionP2 = 0.0,
270 double _cx = 0.5,
double _cy = 0.5);
296 const std::string &_cameraName,
297 const ignition::math::Vector3d &_pos =
298 ignition::math::Vector3d::Zero,
299 const ignition::math::Vector3d &_rpy =
300 ignition::math::Vector3d::Zero,
301 unsigned int _width = 320,
302 unsigned int _height = 240,
304 const double _hfov = 60,
305 const std::string &_lensType =
"stereographic",
306 const bool _scaleToHfov =
true,
307 const double _cutoffAngle = 3.1415,
308 const double _envTextureSize = 512,
309 const double _c1 = 1.05,
const double _c2 = 4,
310 const double _f = 1.0,
311 const std::string &_fun =
"tan");
329 const std::string &_raySensorName,
330 const ignition::math::Vector3d &_pos =
331 ignition::math::Vector3d::Zero,
332 const ignition::math::Vector3d &_rpy =
333 ignition::math::Vector3d::Zero,
334 double _hMinAngle = -2.0,
double _hMaxAngle = 2.0,
335 double _vMinAngle = -1.0,
double _vMaxAngle = 1.0,
336 double _minRange = 0.08,
double _maxRange = 10,
337 double _rangeResolution = 0.01,
unsigned int _samples = 640,
338 unsigned int _vSamples = 1,
double _hResolution = 1.0,
339 double _vResolution = 1.0,
340 const std::string &_noiseType =
"",
double _noiseMean = 0.0,
341 double _noiseStdDev = 0.0);
351 const std::string &_sonarName,
352 const ignition::math::Pose3d &_pose,
353 const double _minRange,
354 const double _maxRange,
355 const double _radius);
372 const std::string &_raySensorName,
373 const ignition::math::Vector3d &_pos =
374 ignition::math::Vector3d::Zero,
375 const ignition::math::Vector3d &_rpy =
376 ignition::math::Vector3d::Zero,
377 double _hMinAngle = -2.0,
double _hMaxAngle = 2.0,
378 double _minRange = 0.08,
double _maxRange = 10,
379 double _rangeResolution = 0.01,
unsigned int _samples = 640,
380 const std::string &_noiseType =
"",
double _noiseMean = 0.0,
381 double _noiseStdDev = 0.0);
403 const std::string &_raySensorName,
404 const ignition::math::Vector3d &_pos,
405 const ignition::math::Vector3d &_rpy,
406 double _hMinAngle = -2.0,
double _hMaxAngle = 2.0,
407 double _vMinAngle = -1.0,
double _vMaxAngle = 1.0,
408 double _minRange = 0.08,
double _maxRange = 10,
409 double _rangeResolution = 0.01,
unsigned int _samples = 640,
410 unsigned int _vSamples = 1,
double _hResolution = 1.0,
411 double _vResolution = 1.0,
412 const std::string &_noiseType =
"",
double _noiseMean = 0.0,
413 double _noiseStdDev = 0.0);
426 const std::string &_cameraName,
427 const ignition::math::Vector3d &_pos =
428 ignition::math::Vector3d::Zero,
429 const ignition::math::Vector3d &_rpy =
430 ignition::math::Vector3d::Zero,
431 const unsigned int _width = 320,
432 const unsigned int _height = 240,
433 const double _rate = 25,
const double _near = 0.1,
434 const double _far = 10);
450 const std::string &_imuSensorName,
451 const ignition::math::Vector3d &_pos =
452 ignition::math::Vector3d::Zero,
453 const ignition::math::Vector3d &_rpy =
454 ignition::math::Vector3d::Zero,
455 const std::string &_noiseType =
"",
456 double _rateNoiseMean = 0.0,
double _rateNoiseStdDev = 0.0,
457 double _rateBiasMean = 0.0,
double _rateBiasStdDev = 0.0,
458 double _accelNoiseMean = 0.0,
double _accelNoiseStdDev = 0.0,
459 double _accelBiasMean = 0.0,
double _accelBiasStdDev = 0.0);
469 const std::string &_sensorName,
470 const std::string &_collisionType,
471 const ignition::math::Vector3d &_pos =
472 ignition::math::Vector3d::Zero,
473 const ignition::math::Vector3d &_rpy =
474 ignition::math::Vector3d::Zero,
475 bool _static =
false);
486 const std::string &_sensorName,
487 const std::string &_collisionType,
488 const std::string &_topic,
489 const ignition::math::Vector3d &_pos =
490 ignition::math::Vector3d::Zero,
491 const ignition::math::Vector3d &_rpy =
492 ignition::math::Vector3d::Zero,
493 bool _static =
false);
504 const std::string &_sensorName,
505 const std::string &_collisionType,
506 const std::string &_topic,
507 const ignition::math::Vector3d &_pos =
508 ignition::math::Vector3d::Zero,
509 const ignition::math::Vector3d &_rpy =
510 ignition::math::Vector3d::Zero,
511 bool _static =
false);
522 const std::string &_sensorName,
523 const std::string &_collisionType,
524 const std::string &_topic,
525 const ignition::math::Vector3d &_pos =
526 ignition::math::Vector3d::Zero,
527 const ignition::math::Vector3d &_rpy =
528 ignition::math::Vector3d::Zero,
529 bool _static =
false);
535 private:
void launchTimeoutFailure(
const char *_logMsg,
536 const int _timeoutCS);
549 const std::string &_sensorName,
550 const ignition::math::Vector3d &_pos,
551 const ignition::math::Vector3d &_rpy,
552 const std::string &_essid,
556 bool _visualize =
true);
570 const std::string &_sensorName,
571 const ignition::math::Vector3d &_pos,
572 const ignition::math::Vector3d &_rpy,
578 bool _visualize =
true);
585 unsigned int _sleepEach,
593 unsigned int _sleepEach,
602 const int _sleepEach,
603 const int _retries)
const;
612 const int _maxRetries)
const;
630 protected:
void SpawnLight(
const std::string &_name,
631 const std::string &_type,
632 const ignition::math::Vector3d &_pos =
633 ignition::math::Vector3d::Zero,
634 const ignition::math::Vector3d &_rpy =
635 ignition::math::Vector3d::Zero,
636 const ignition::math::Color &_diffuse =
637 ignition::math::Color::White,
638 const ignition::math::Color &_specular =
639 ignition::math::Color::White,
640 const ignition::math::Vector3d &_direction =
641 -ignition::math::Vector3d::UnitZ,
642 const double _attenuationRange = 20,
643 const double _attenuationConstant = 0.5,
644 const double _attenuationLinear = 0.01,
645 const double _attenuationQuadratic = 0.001,
646 const double _spotInnerAngle = 0,
647 const double _spotOuterAngle = 0,
648 const double _spotFallOff = 0,
649 const bool _castShadows =
true);
657 const ignition::math::Vector3d &_pos =
658 ignition::math::Vector3d::Zero,
659 const ignition::math::Vector3d &_rpy =
660 ignition::math::Vector3d::Zero,
661 bool _static =
false);
670 protected:
void SpawnSphere(
const std::string &_name,
671 const ignition::math::Vector3d &_pos,
672 const ignition::math::Vector3d &_rpy,
673 bool _wait =
true,
bool _static =
false);
684 protected:
void SpawnSphere(
const std::string &_name,
685 const ignition::math::Vector3d &_pos,
686 const ignition::math::Vector3d &_rpy,
687 const ignition::math::Vector3d &_cog,
688 double _radius = 1.0,
689 bool _wait =
true,
bool _static =
false);
697 protected:
void SpawnBox(
const std::string &_name,
698 const ignition::math::Vector3d &_size =
699 ignition::math::Vector3d::One,
700 const ignition::math::Vector3d &_pos =
701 ignition::math::Vector3d::Zero,
702 const ignition::math::Vector3d &_rpy =
703 ignition::math::Vector3d::Zero,
704 bool _static =
false);
714 const std::string &_modelPath,
715 const ignition::math::Vector3d &_scale =
716 ignition::math::Vector3d::One,
717 const ignition::math::Vector3d &_pos =
718 ignition::math::Vector3d::Zero,
719 const ignition::math::Vector3d &_rpy =
720 ignition::math::Vector3d::Zero,
721 bool _static =
false);
729 const ignition::math::Vector3d &_pos =
730 ignition::math::Vector3d::Zero,
731 const ignition::math::Vector3d &_rpy =
732 ignition::math::Vector3d::Zero,
733 bool _static =
false);
737 protected:
void SpawnModel(
const std::string &_filename);
741 protected:
void SpawnSDF(
const std::string &_sdf);
746 protected:
void LoadPlugin(
const std::string &_filename,
747 const std::string &_name);
756 protected:
void RemoveModel(
const std::string &_name);
765 protected:
void GetMemInfo(
double &_resident,
double &_share);
775 protected:
void Record(
const std::string &_name,
const double _data);
780 protected:
void Record(
const std::string &_prefix,
781 const ignition::math::SignalStats &_stats);
786 protected:
void Record(
const std::string &_prefix,
787 const ignition::math::Vector3Stats &_stats);
811 protected: std::map<std::string, ignition::math::Pose3d>
poses;
817 private:
unsigned char **imgData;
820 private:
int gotImage;
826 private:
double percentRealTime;
829 private:
bool paused;
832 private:
bool serverRunning;
835 private:
int uniqueCounter;
841 public:
virtual void SetUp();
844 protected:
virtual void Unload();
847 #endif // define _GAZEBO_SERVER_FIXTURE_HH_ ServerFixture()
Constructor.
void Record(const std::string &_name, const double _data)
Helper to record data to gtest xml output.
physics::ModelPtr GetModel(const std::string &_name)
Get a pointer to a model.
void WaitUntilSimTime(const common::Time &_goalTime, const int _ms, const int _maxRetries) const
Wait for a number of ms.
void WaitUntilEntitySpawn(const std::string &_name, unsigned int _sleepEach, int _retries)
Wait for a number of ms.
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.
transport::SubscriberPtr statsSub
World statistics subscription.
Definition: ServerFixture.hh:802
transport::SubscriberPtr poseSub
Pose subscription.
Definition: ServerFixture.hh:799
void RemoveModel(const std::string &_name)
Remove a model by name.
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.
Forward declarations for the common classes.
Definition: Animation.hh:26
std::string GetUniqueString(const std::string &_prefix)
Get unique string with a specified prefix.
void WaitUntilSensorSpawn(const std::string &_name, unsigned int _sleepEach, int _retries)
Wait for a number of ms.
Definition: ServerFixture.hh:66
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.
std::string custom_exec(std::string _cmd)
transport::PublisherPtr factoryPub
Factory publisher.
Definition: ServerFixture.hh:805
ignition::math::Pose3d EntityPose(const std::string &_name)
Get the pose of an entity.
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.
void RemovePlugin(const std::string &_name)
Remove a plugin.
boost::shared_ptr< Publisher > PublisherPtr
Definition: TransportTypes.hh:49
boost::shared_ptr< Subscriber > SubscriberPtr
Definition: TransportTypes.hh:53
void WaitUntilIteration(const uint32_t _goalIteration, const int _sleepEach, const int _retries) const
Wait for a number of ms.
virtual ~ServerFixture()
Destructor.
void GetMemInfo(double &_resident, double &_share)
Get the current memory information.
boost::thread * serverThread
Pointer the thread the runs the server.
Definition: ServerFixture.hh:793
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.
rendering::ScenePtr GetScene(const std::string &_sceneName="default")
Get a pointer to the rendering scene.
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.
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).
void SpawnSDF(const std::string &_sdf)
Send a factory message based on an SDF string.
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.
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).
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
default namespace for gazebo
virtual void Load(const std::string &_worldFilename)
Load a world based on a filename.
void PrintImage(const std::string &_name, unsigned char **_image, unsigned int _width, unsigned int _height, unsigned int _depth)
Print image data to screen.
void SetPause(bool _pause)
Set a running simulation paused/unpaused.
virtual void Unload()
Unload the test fixture.
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 ignition::math::Color &_diffuse=ignition::math::Color::White, const ignition::math::Color &_specular=ignition::math::Color::White, const ignition::math::Vector3d &_direction=-ignition::math::Vector3d::UnitZ, const double _attenuationRange=20, const double _attenuationConstant=0.5, const double _attenuationLinear=0.01, const double _attenuationQuadratic=0.001, const double _spotInnerAngle=0, const double _spotOuterAngle=0, const double _spotFallOff=0, const bool _castShadows=true)
Spawn a light.
void RunServer(const std::vector< std::string > &_args)
Run the server.
transport::NodePtr node
Pointer to a node for communication.
Definition: ServerFixture.hh:796
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.
Definition: ServerFixture.hh:838
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.
boost::shared_ptr< Scene > ScenePtr
Definition: RenderTypes.hh:82
void LoadPlugin(const std::string &_filename, const std::string &_name)
Load a plugin.
bool HasEntity(const std::string &_name)
Return true if the named entity exists.
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.
virtual void LoadArgs(const std::string &_args)
Load a world in gzserver.
common::Time simTime
Current simulation time, real time, and pause time.
Definition: ServerFixture.hh:823
void GetFrame(const std::string &_cameraName, unsigned char **_imgData, unsigned int &_width, unsigned int &_height)
Get an image frame from a camera.
std::mutex receiveMutex
Mutex to protect data structures that store messages.
Definition: ServerFixture.hh:814
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.
static void CheckPointer(boost::shared_ptr< T > _ptr)
Check that a pointer is not NULL.
Definition: ServerFixture.hh:233
std::map< std::string, ignition::math::Pose3d > poses
Map of received poses.
Definition: ServerFixture.hh:811
common::Time realTime
Definition: ServerFixture.hh:823
#define NULL
Definition: CommonTypes.hh:31
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.
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.
transport::PublisherPtr requestPub
Request publisher.
Definition: ServerFixture.hh:808
void PrintScan(const std::string &_name, double *_scan, unsigned int _sampleCount)
Print laser scan to screen.
Server * server
Pointer the Gazebo server.
Definition: ServerFixture.hh:790
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:94
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.
void OnPose(ConstPosesStampedPtr &_msg)
Function that received poses messages from a running simulation.
virtual void TearDown()
Tear down the test fixture. This gets called by gtest.
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.
double GetPercentRealTime() const
Get the real-time factor.
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.
common::Time pauseTime
Definition: ServerFixture.hh:823
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.
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.
std::shared_ptr< SonarSensor > SonarSensorPtr
Definition: SensorTypes.hh:112
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.
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:59
void SpawnGpuRaySensorVertical(const std::string &_modelName, const std::string &_raySensorName, const ignition::math::Vector3d &_pos, const ignition::math::Vector3d &_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)
Spawn a gpu laser.
physics::ModelPtr SpawnModel(const msgs::Model &_msg)
Spawn a model from a msgs::Model and return ModelPtr.
void OnStats(ConstWorldStatisticsPtr &_msg)
Function that received world stastics messages.
A Time class, can be used to hold wall- or sim-time.
Definition: Time.hh:47