An abstract gazebo model plugin for tracked vehicles.
More...
#include <TrackedVehiclePlugin.hh>
Inherits ModelPlugin.
Inherited by SimpleTrackedVehiclePlugin, and WheelTrackedVehiclePlugin.
|
typedef boost::shared_ptr< ModelPlugin > | TPtr |
| plugin pointer type definition
|
|
|
static TPtr | Create (const std::string &_filename, const std::string &_name) |
| a class method that creates a plugin from a file name.
|
|
|
virtual std::string | GetRobotNamespace () |
| Namespace used as a prefix for gazebo topic names.
|
|
virtual double | GetSteeringEfficiency () |
| Steering efficiency coefficient (between 0.0 and 1.0).
|
|
virtual boost::optional< double > | GetTrackMu () |
| Friction coefficient in the first friction direction.
|
|
virtual boost::optional< double > | GetTrackMu2 () |
| Friction coefficient in the second friction direction.
|
|
virtual double | GetTracksSeparation () |
| Distance between the centers of the tracks.
|
|
void | LoadParam (const sdf::ElementPtr &_sdf, const std::string &_name, V &_target, V _defaultValue=V()) const |
| Load parameter value from _sdf and store it to the given reference, using the supplied default value if the element in _sdf is not found.
|
|
void | LoadParam (sdf::ElementPtr &_sdf, const std::string &_name, std::string &_target, const char *_defaultValue) const |
| Load parameter value from _sdf and store it to the given reference, using the supplied default value if the element in _sdf is not found.
|
|
virtual void | OnVelMsg (ConstPosePtr &_msg) GAZEBO_DEPRECATED(9.0) |
| Callback for setting desired body velocity.
|
|
void | OnVelMsg (ConstTwistPtr &_msg) |
| Callback for setting desired body velocity.
|
|
void | SetBodyVelocity (double _linear, double _angular) |
| Set new target velocity for the tracks based on the desired.
|
|
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 | SetSteeringEfficiency (double _steeringEfficiency) |
| Set steering efficiency coefficient (between 0.0 and 1.0).
|
|
virtual void | SetTrackMu (double _mu) |
| Friction coefficient in the first friction direction.
|
|
virtual void | SetTrackMu2 (double _mu2) |
| Friction coefficient in the second friction direction.
|
|
virtual void | SetTrackVelocity (double _left, double _right) |
| Set new target velocity for the tracks.
|
|
virtual void | SetTrackVelocityImpl (double _left, double _right)=0 |
| Set new target velocity for the tracks.
|
|
virtual void | UpdateTrackSurface ()=0 |
| Update surface parameters of the tracks to correspond to the values set in this plugin.
|
|
An abstract gazebo model plugin for tracked vehicles.
- Since
- 8.1
The plugin processes the following parameters (all have defaults): <steering_efficiency> Steering efficiency coefficient (0.0 to 1.0). Default is 0.5. <tracks_separation> Distance between the centers of the tracks. Default is 0.4. Implementation may try to autodetect this value. <max_linear_speed> Max linear velocity in m/s. Also max track velocity. Default is 1.0. <max_angular_speed> Max angular speed in rad/s. Default is 1.0. <track_mu> Friction coefficient in the first friction direction. If not set, mu of the tracks is not changed, so the values from model definition are used. <track_mu2> Friction coefficient in the second friction direction. If not set, mu of the tracks is not changed, so the values from model definition are used. <robot_namespace> Namespace used as a prefix for gazebo topic names. Default is the name of the model.
◆ TPtr
plugin pointer type definition
◆ TrackedVehiclePlugin()
◆ ~TrackedVehiclePlugin()
◆ Create()
static TPtr Create |
( |
const std::string & | _filename, |
|
|
const std::string & | _name ) |
|
inlinestaticinherited |
a class method that creates a plugin from a file name.
It locates the shared library and loads it dynamically.
- Parameters
-
[in] | _filename | the path to the shared library. |
[in] | _name | short name of the plugin |
- Returns
- Shared Pointer to this class type
◆ GetFilename()
std::string GetFilename |
( |
| ) |
const |
|
inlineinherited |
Get the name of the handler.
◆ GetHandle()
std::string GetHandle |
( |
| ) |
const |
|
inlineinherited |
Get the short name of the handler.
◆ GetRobotNamespace()
virtual std::string GetRobotNamespace |
( |
| ) |
|
|
protectedvirtual |
Namespace used as a prefix for gazebo topic names.
◆ GetSteeringEfficiency()
virtual double GetSteeringEfficiency |
( |
| ) |
|
|
protectedvirtual |
Steering efficiency coefficient (between 0.0 and 1.0).
◆ GetTrackMu()
virtual boost::optional< double > GetTrackMu |
( |
| ) |
|
|
protectedvirtual |
Friction coefficient in the first friction direction.
◆ GetTrackMu2()
virtual boost::optional< double > GetTrackMu2 |
( |
| ) |
|
|
protectedvirtual |
Friction coefficient in the second friction direction.
◆ GetTracksSeparation()
virtual double GetTracksSeparation |
( |
| ) |
|
|
protectedvirtual |
Distance between the centers of the tracks.
◆ GetType()
Returns the type of the plugin.
- Returns
- type of the plugin
◆ Init()
◆ Load()
Called when the plugin is loaded.
- Parameters
-
[in] | _model | Pointer to the model for which the plugin is loaded |
[in] | _sdf | Pointer to the SDF for _model |
Implements ModelPlugin.
Reimplemented in WheelTrackedVehiclePlugin.
◆ LoadParam() [1/2]
void LoadParam |
( |
const sdf::ElementPtr & | _sdf, |
|
|
const std::string & | _name, |
|
|
V & | _target, |
|
|
V | _defaultValue = V() ) const |
|
inlineprotectedinherited |
Load parameter value from _sdf and store it to the given reference, using the supplied default value if the element in _sdf is not found.
A message is written using gzmsg reporting whether the default value was used or not.
- Parameters
-
[in] | _sdf | The SDF element of the plugin. |
[in] | _name | Name of a tag inside the SDF. |
[out] | _target | The reference to store the param value to. |
[in] | _defaultValue | The default value. |
◆ LoadParam() [2/2]
void LoadParam |
( |
sdf::ElementPtr & | _sdf, |
|
|
const std::string & | _name, |
|
|
std::string & | _target, |
|
|
const char * | _defaultValue ) const |
|
inlineprotectedinherited |
Load parameter value from _sdf and store it to the given reference, using the supplied default value if the element in _sdf is not found.
A message is written using gzmsg reporting whether the default value was used or not. String specialization to allow accepting const char* values for std::string parameters.
- Parameters
-
[in] | _sdf | The SDF element of the plugin. |
[in] | _name | Name of a tag inside the SDF. |
[out] | _target | The reference to store the param value to. |
[in] | _defaultValue | The default value. |
◆ OnVelMsg() [1/2]
virtual void OnVelMsg |
( |
ConstPosePtr & | _msg | ) |
|
|
protectedvirtual |
Callback for setting desired body velocity.
Normally, this callback converts the x/yaw message to track velocities and calls SetTrackVelocity().
- Parameters
-
[in] | _msg | Pose message from external publisher |
◆ OnVelMsg() [2/2]
void OnVelMsg |
( |
ConstTwistPtr & | _msg | ) |
|
|
protected |
Callback for setting desired body velocity.
Normally, this callback converts the x/yaw message to track velocities and calls SetTrackVelocity().
- Parameters
-
[in] | _msg | Twist message from external publisher |
◆ Reset()
◆ SetBodyVelocity()
void SetBodyVelocity |
( |
double | _linear, |
|
|
double | _angular ) |
|
protected |
Set new target velocity for the tracks based on the desired.
- Parameters
-
[in] | _linear | Desired linear velocity of the vehicle. |
[in] | _angular | Desired angular velocity of the vehicle. |
◆ SetLinkMu()
Set mu and mu2 of all collisions of the given link to values given by GetTrackMu() and GetTrackMu2().
- Parameters
-
[in] | _link | The link whose "mu"s are to be set. |
◆ SetSteeringEfficiency()
virtual void SetSteeringEfficiency |
( |
double | _steeringEfficiency | ) |
|
|
protectedvirtual |
Set steering efficiency coefficient (between 0.0 and 1.0).
- Parameters
-
[in] | _steeringEfficiency | The new steering efficiency. |
◆ SetTrackMu()
virtual void SetTrackMu |
( |
double | _mu | ) |
|
|
protectedvirtual |
Friction coefficient in the first friction direction.
- Parameters
-
[in] | _mu | The new coefficient. |
◆ SetTrackMu2()
virtual void SetTrackMu2 |
( |
double | _mu2 | ) |
|
|
protectedvirtual |
Friction coefficient in the second friction direction.
- Parameters
-
[in] | _mu2 | The new coefficient. |
◆ SetTrackVelocity()
virtual void SetTrackVelocity |
( |
double | _left, |
|
|
double | _right ) |
|
protectedvirtual |
Set new target velocity for the tracks.
Descendant classes need to implement this function.
- Parameters
-
[in] | _left | Velocity of left track. |
[in] | _right | Velocity of right track. |
◆ SetTrackVelocityImpl()
virtual void SetTrackVelocityImpl |
( |
double | _left, |
|
|
double | _right ) |
|
protectedpure virtual |
◆ UpdateTrackSurface()
virtual void UpdateTrackSurface |
( |
| ) |
|
|
protectedpure virtual |
◆ filename
Path to the shared library file.
◆ handleName
◆ mutex
Mutex to protect updates.
◆ trackNames
std::unordered_map<Tracks, std::string> trackNames |
|
protected |
Textual lowercase names of the tracks.
◆ type
The documentation for this class was generated from the following file: