WheelSlipPlugin.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 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 #ifndef GAZEBO_PLUGINS_WHEELSLIPPLUGIN_HH_
18 #define GAZEBO_PLUGINS_WHEELSLIPPLUGIN_HH_
19 
20 #include <map>
21 #include <memory>
22 #include <string>
23 
24 #include <ignition/math/Vector3.hh>
25 
26 #include <gazebo/common/Plugin.hh>
27 #include <gazebo/util/system.hh>
28 
29 namespace gazebo
30 {
31  // Forward declare private data class
32  class WheelSlipPluginPrivate;
33 
67 
103  {
105  public: WheelSlipPlugin();
106 
108  public: virtual ~WheelSlipPlugin();
109 
110  // Documentation inherited
111  public: virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);
112 
113  // Documentation inherited
114  public: virtual void Fini();
115 
118  public: physics::ModelPtr GetParentModel() const;
119 
125  public: void GetSlips(std::map<std::string, ignition::math::Vector3d> &_out)
126  const;
127 
130  public: void SetSlipComplianceLateral(const double _compliance);
131 
134  public: void SetSlipComplianceLongitudinal(const double _compliance);
135 
138  private: void OnLateralCompliance(ConstGzStringPtr &_msg);
139 
142  private: void OnLongitudinalCompliance(ConstGzStringPtr &_msg);
143 
146  private: void Update();
147 
149  private: std::unique_ptr<WheelSlipPluginPrivate> dataPtr;
150  };
151 }
152 #endif
Forward declarations for the common classes.
Definition: Animation.hh:26
A plugin that updates ODE wheel slip parameters based on linear wheel spin velocity (radius * spin ra...
Definition: WheelSlipPlugin.hh:102
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:93
A plugin with access to physics::Model.
Definition: Plugin.hh:305
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:59