ROSBaseSensorPlugin.cc
Go to the documentation of this file.
1 // Copyright (c) 2016 The UUV Simulator Authors.
2 // All rights reserved.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
17 
18 namespace gazebo
19 {
20 
23 { }
24 
27 { }
28 
30 void ROSBaseSensorPlugin::Load(sensors::SensorPtr _model, sdf::ElementPtr _sdf)
31 {
32  // Initialize model pointer
33  #if GAZEBO_MAJOR_VERSION >= 7
34  this->parentSensor = std::dynamic_pointer_cast<sensors::Sensor>(_model);
35  #else
36  this->parentSensor = boost::dynamic_pointer_cast<sensors::Sensor>(_model);
37  #endif
38 
39  // Get the world name.
40  std::string worldName = _model->WorldName();
41  this->world = physics::get_world(worldName);
42 
43  this->InitBasePlugin(_sdf);
44 }
45 
47 bool ROSBaseSensorPlugin::OnUpdate(const common::UpdateInfo&)
48 {
49  return true;
50 }
51 
52 }
virtual ~ROSBaseSensorPlugin()
Class destructor.
virtual void Load(sensors::SensorPtr _model, sdf::ElementPtr _sdf)
Load plugin and its configuration from sdf,.
ROSBaseSensorPlugin()
Class constructor.
physics::WorldPtr world
Pointer to the world.
virtual bool OnUpdate(const common::UpdateInfo &)
Update callback from simulation.
bool InitBasePlugin(sdf::ElementPtr _sdf)
Initialize base plugin.
sensors::SensorPtr parentSensor
Pointer to the parent sensor.


uuv_sensor_ros_plugins
Author(s): Musa Morena Marcusso Manhaes , Sebastian Scherer , Luiz Ricardo Douat
autogenerated on Mon Jul 1 2019 19:39:20