ElevatorPlugin.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2015 Open Source Robotics Foundation
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 *
16*/
17
18#ifndef GAZEBO_PLUGINS_ELEVATORPLUGIN_HH_
19#define GAZEBO_PLUGINS_ELEVATORPLUGIN_HH_
20
21#include <memory>
22#include <string>
23
24#include <sdf/sdf.hh>
25
26#include <gazebo/msgs/msgs.hh>
29#include <gazebo/util/system.hh>
30
31namespace gazebo
32{
34 class ElevatorPluginPrivate;
35
53 class GZ_PLUGIN_VISIBLE ElevatorPlugin : public ModelPlugin
54 {
56 public: ElevatorPlugin();
57
59 public: ~ElevatorPlugin();
60
61 // Documentation inherited
62 public: virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);
63
64 // Documentation inherited
65 public: virtual void Reset();
66
69 public: void MoveToFloor(const int _floor);
70
73 private: void Update(const common::UpdateInfo &_info);
74
77 private: void OnElevator(ConstGzStringPtr &_msg);
78
80 private: std::unique_ptr<ElevatorPluginPrivate> dataPtr;
81 };
82}
83#endif
Plugin to control a elevator.
Definition ElevatorPlugin.hh:54
virtual void Reset()
Override this method for custom plugin reset behavior.
~ElevatorPlugin()
Destructor.
void MoveToFloor(const int _floor)
Move to a particular floor.
ElevatorPlugin()
Constructor.
virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf)
Load function.
A plugin with access to physics::Model.
Definition Plugin.hh:304
Information for use in an update event.
Definition UpdateInfo.hh:31
boost::shared_ptr< Model > ModelPtr
Definition PhysicsTypes.hh:93
Forward declarations for the common classes.
Definition Animation.hh:27