18 #ifndef GAZEBO_WHEELTRACKEDVEHICLEPLUGIN_HH
19 #define GAZEBO_WHEELTRACKEDVEHICLEPLUGIN_HH
24 #include <unordered_map>
62 public:
void Init()
override;
84 const std::string &_jointName);
105 protected: std::unordered_map<Tracks, WheelInfo_V>
wheels;
121 private:
void OnUpdate();
An abstract gazebo model plugin for tracked vehicles.
Definition: TrackedVehiclePlugin.hh:80
An approximate model of non-deformable tracks emulated by wheels.
Definition: WheelTrackedVehiclePlugin.hh:51
physics::WorldPtr world
Pointer to the world the model lives in.
Definition: WheelTrackedVehiclePlugin.hh:114
std::mutex mutex
Mutex to protect updates.
Definition: WheelTrackedVehiclePlugin.hh:117
virtual ~WheelTrackedVehiclePlugin()=default
void LoadWheel(physics::ModelPtr &_model, Tracks &_track, const std::string &_jointName)
Load a wheel connected to joint named jointName and append it to this->wheels[track].
void Init() override
Initialize the plugin.
std::shared_ptr< WheelInfo > WheelInfoPtr
Definition: WheelTrackedVehiclePlugin.hh:101
void SetTrackVelocityImpl(double _left, double _right) override
Set new target velocity for the tracks.
std::unordered_map< Tracks, double > trackVelocity
Desired velocities of the tracks.
Definition: WheelTrackedVehiclePlugin.hh:108
void Load(physics::ModelPtr _model, sdf::ElementPtr _sdf) override
Called when the plugin is loaded.
WheelTrackedVehiclePlugin()=default
std::vector< WheelInfoPtr > WheelInfo_V
Definition: WheelTrackedVehiclePlugin.hh:102
std::unordered_map< Tracks, WheelInfo_V > wheels
The wheels on the LEFT/RIGHT track.
Definition: WheelTrackedVehiclePlugin.hh:105
double defaultWheelRadius
The radius (in meters) used for wheels where autodetection fails.
Definition: WheelTrackedVehiclePlugin.hh:111
void UpdateTrackSurface() override
Update surface parameters of the tracks to correspond to the values set in this plugin.
void Reset() override
Reset the plugin.
boost::shared_ptr< Connection > ConnectionPtr
Definition: CommonTypes.hh:134
boost::shared_ptr< World > WorldPtr
Definition: PhysicsTypes.hh:90
boost::shared_ptr< Model > ModelPtr
Definition: PhysicsTypes.hh:94
boost::shared_ptr< Joint > JointPtr
Definition: PhysicsTypes.hh:118
Forward declarations for the common classes.
Definition: Animation.hh:27
Tracks
Enum for distinguishing between left and right tracks.
Definition: TrackedVehiclePlugin.hh:40
Holds information about each wheel.
Definition: WheelTrackedVehiclePlugin.hh:89
physics::JointPtr joint
The hinge joint connecting the wheel to the track/body.
Definition: WheelTrackedVehiclePlugin.hh:91
double radius
Radius of the wheel (used to convert linear to angular speed).
Definition: WheelTrackedVehiclePlugin.hh:98
std::string jointName
Name of the hinge joint.
Definition: WheelTrackedVehiclePlugin.hh:94