SkidSteerDrivePlugin.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 #ifndef _GAZEBO_SkidSteerDrive_PLUGIN_HH_
18 #define _GAZEBO_SkidSteerDrive_PLUGIN_HH_
19 
20 #include <string>
21 
22 #include "gazebo/common/Plugin.hh"
23 #include "gazebo/physics/physics.hh"
25 #include "gazebo/util/system.hh"
26 
27 #define NUMBER_OF_WHEELS 4
28 
29 namespace gazebo
30 {
31  // \class SkidSteerDrivePlugin SkidSteerDrivePlugin.hh
36  {
38  public: SkidSteerDrivePlugin();
39 
43  public: void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);
44 
46  public: enum {RIGHT_FRONT, RIGHT_REAR, LEFT_FRONT, LEFT_REAR};
47 
52  private: int RegisterJoint(int _index, const std::string &_name);
53 
56  private: void OnVelMsg(ConstPosePtr &_msg);
57 
59  private: transport::NodePtr node;
60 
62  private: transport::SubscriberPtr velSub;
63 
65  private: physics::ModelPtr model;
66 
68  private: physics::JointPtr joints[NUMBER_OF_WHEELS];
69 
71  private: double wheelSeparation;
72 
74  private: double wheelRadius;
75  };
76 }
77 #endif
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:88
boost::shared_ptr< Subscriber > SubscriberPtr
Definition: TransportTypes.hh:53
#define NUMBER_OF_WHEELS
Definition: SkidSteerDrivePlugin.hh:27
Forward declarations for transport.
A gazebo model plugin that controls a four wheel skid-steer robot via a gazebo topic.
Definition: SkidSteerDrivePlugin.hh:35
boost::shared_ptr< Joint > JointPtr
Definition: PhysicsTypes.hh:108
boost::shared_ptr< Node > NodePtr
Definition: TransportTypes.hh:57
Definition: SkidSteerDrivePlugin.hh:46
A plugin with access to physics::Model.
Definition: Plugin.hh:245
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:59