Advertisement
Guest User

Untitled

a guest
Mar 6th, 2013
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.60 KB | None | 0 0
  1. /*
  2.  * Copyright 2012 Open Source Robotics Foundation
  3.  * Copyright 2013 Dereck Wonnacott
  4.  *
  5.  * Licensed under the Apache License, Version 2.0 (the "License");
  6.  * you may not use this file except in compliance with the License.
  7.  * You may obtain a copy of the License at
  8.  *
  9.  *     http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  *
  17. */
  18. #ifndef __GAZEBO_SkidSteerDrive_PLUGIN_HH__
  19. #define __GAZEBO_SkidSteerDrive_PLUGIN_HH__
  20.  
  21. #include "common/common.hh"
  22. #include "physics/physics.hh"
  23. #include "transport/TransportTypes.hh"
  24. #include "gazebo.hh"
  25.  
  26. #define NUMBER_OF_WHEELS 4
  27.  
  28. namespace gazebo
  29. {
  30.   class SkidSteerDrivePlugin : public ModelPlugin
  31.   {
  32.     public: SkidSteerDrivePlugin();
  33.     public: virtual void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf);
  34.  
  35.     public: enum {RIGHT_FRONT, RIGHT_REAR, LEFT_FRONT, LEFT_REAR};
  36.  
  37.     private: void RegisterJoint(int index, std::string name);
  38.     private: void OnVelMsg(ConstPosePtr &_msg);
  39.  
  40.     private: transport::NodePtr node;
  41.     private: transport::SubscriberPtr velSub;
  42.  
  43.     private: physics::ModelPtr model;
  44.     private: physics::JointPtr Joints[NUMBER_OF_WHEELS];
  45.  
  46.     private: double MaxForce;
  47.     private: double wheelSeparation;
  48.     private: double wheelRadius;
  49.    
  50.     private: bool fatal_error;
  51.   };
  52. }
  53. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement