17#ifndef GAZEBO_PLUGINS_TRACKEDVEHICLEPLUGIN_HH_
18#define GAZEBO_PLUGINS_TRACKEDVEHICLEPLUGIN_HH_
21#include <unordered_map>
23#include <boost/algorithm/string.hpp>
24#include <boost/optional.hpp>
30#include "gazebo/physics/physics.hh"
32#include "gazebo/msgs/pose.pb.h"
33#include "gazebo/msgs/twist.pb.h"
45 template <>
struct hash<
gazebo::Tracks>
56 class TrackedVehiclePluginPrivate;
93 public:
void Init()
override;
136 protected: std::unordered_map<Tracks, std::string>
trackNames;
163 double _linear,
double _angular);
185 private: std::unique_ptr<TrackedVehiclePluginPrivate> dataPtr;
Forward declarations for transport.
A plugin with access to physics::Model.
Definition Plugin.hh:304
An abstract gazebo model plugin for tracked vehicles.
Definition TrackedVehiclePlugin.hh:80
virtual double GetSteeringEfficiency()
Steering efficiency coefficient (between 0.0 and 1.0).
virtual void UpdateTrackSurface()=0
Update surface parameters of the tracks to correspond to the values set in this plugin.
virtual std::string GetRobotNamespace()
Namespace used as a prefix for gazebo topic names.
std::mutex mutex
Mutex to protect updates.
Definition TrackedVehiclePlugin.hh:182
virtual void SetTrackVelocity(double _left, double _right)
Set new target velocity for the tracks.
void SetLinkMu(const physics::LinkPtr &_link)
Set mu and mu2 of all collisions of the given link to values given by GetTrackMu() and GetTrackMu2().
virtual void SetTrackMu(double _mu)
Friction coefficient in the first friction direction.
void Init() override
Initialize the plugin.
virtual ~TrackedVehiclePlugin()
Destructor.
virtual void SetSteeringEfficiency(double _steeringEfficiency)
Set steering efficiency coefficient (between 0.0 and 1.0).
void OnVelMsg(ConstTwistPtr &_msg)
Callback for setting desired body velocity.
virtual void SetTrackMu2(double _mu2)
Friction coefficient in the second friction direction.
virtual boost::optional< double > GetTrackMu2()
Friction coefficient in the second friction direction.
void SetBodyVelocity(double _linear, double _angular)
Set new target velocity for the tracks based on the desired.
virtual void OnVelMsg(ConstPosePtr &_msg) GAZEBO_DEPRECATED(9.0)
Callback for setting desired body velocity.
void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf) override
Called when the plugin is loaded.
virtual void SetTrackVelocityImpl(double _left, double _right)=0
Set new target velocity for the tracks.
virtual double GetTracksSeparation()
Distance between the centers of the tracks.
virtual boost::optional< double > GetTrackMu()
Friction coefficient in the first friction direction.
std::unordered_map< Tracks, std::string > trackNames
Textual lowercase names of the tracks.
Definition TrackedVehiclePlugin.hh:136
void Reset() override
Reset the plugin.
TrackedVehiclePlugin()
Default Contstuctor.
boost::shared_ptr< Link > LinkPtr
Definition PhysicsTypes.hh:109
boost::shared_ptr< Model > ModelPtr
Definition PhysicsTypes.hh:93
Forward declarations for the common classes.
Definition Animation.hh:27
Tracks
Enum for distinguishing between left and right tracks.
Definition TrackedVehiclePlugin.hh:40
#define GAZEBO_DEPRECATED(version)
Definition system.hh:328