ConveyorBeltPlugin.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2016 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  * Desc: Conveyor Belt Plugin
19  * Author: Deanna Hood
20  */
21 #ifndef _GAZEBO_CONVEYOR_BELT_PLUGIN_HH_
22 #define _GAZEBO_CONVEYOR_BELT_PLUGIN_HH_
23 
24 #include <string>
25 
26 #include "SideContactPlugin.hh"
27 #include <gazebo/msgs/msgs.hh>
28 #include <gazebo/sensors/sensors.hh>
29 #include <gazebo/util/system.hh>
30 #include <ignition/math/Vector3.hh>
31 
32 namespace gazebo
33 {
35  class GAZEBO_VISIBLE ConveyorBeltPlugin : public SideContactPlugin
36  {
38  public: ConveyorBeltPlugin();
39 
41  public: virtual ~ConveyorBeltPlugin();
42 
46  public: virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);
47 
49  protected: void OnUpdate(const common::UpdateInfo &_info);
50 
52  protected: transport::NodePtr node;
53 
55  protected: transport::SubscriberPtr controlCommandSub;
56 
58  protected: void OnControlCommand(ConstHeaderPtr& _msg);
59 
61  protected: ignition::math::Vector3d velocityAxis;
62 
64  protected: double beltVelocity;
65 
67  protected: std::mutex mutex;
68 
70  public: void SetVelocity(double velocity);
71 
74  protected: std::string Topic(std::string topicName) const;
75 
77  protected: void ActOnContactingLinks(double velocity);
78  };
79 }
80 #endif
81 
double beltVelocity
Belt velocity (m/s)
transport::SubscriberPtr controlCommandSub
Subscriber for the control commands.
transport::NodePtr node
Pointer to this node for publishing/subscribing.
A plugin for a model with a contact sensor that only monitors collisions on one of its sides...
std::mutex mutex
Mutex to protect the belt velocity.
ignition::math::Vector3d velocityAxis
Axis for belt velocity in local frame (+Y by default)
A plugin for a conveyor belt.


osrf_gear
Author(s):
autogenerated on Wed Sep 7 2016 03:48:12