class mrpt::kinematics::CVehicleVelCmd_Holo
Overview
Kinematic model for.
#include <mrpt/kinematics/CVehicleVelCmd_Holo.h> class CVehicleVelCmd_Holo: public mrpt::kinematics::CVehicleVelCmd { public: // fields double vel {.0}; double dir_local {.0}; double ramp_time {.0}; double rot_speed {.0}; // construction CVehicleVelCmd_Holo(); CVehicleVelCmd_Holo( double vel, double dir_local, double ramp_time, double rot_speed ); // methods virtual size_t getVelCmdLength() const; virtual std::string getVelCmdDescription(const int index) const; virtual double getVelCmdElement(const int index) const; virtual void setVelCmdElement(const int index, const double val); virtual bool isStopCmd() const; virtual void setToStop(); virtual void cmdVel_scale(double vel_scale); virtual double cmdVel_limits(const mrpt::kinematics::CVehicleVelCmd& prev_vel_cmd, const double beta, const TVelCmdParams& params); };
Inherited Members
public: // structs struct TVelCmdParams; // methods CVehicleVelCmd& operator = (const CVehicleVelCmd& other); virtual size_t getVelCmdLength() const = 0; virtual std::string getVelCmdDescription(const int index) const = 0; virtual double getVelCmdElement(const int index) const = 0; virtual void setVelCmdElement(const int index, const double val) = 0; virtual bool isStopCmd() const = 0; virtual void setToStop() = 0; virtual std::string asString() const; virtual void cmdVel_scale(double vel_scale) = 0; virtual double cmdVel_limits(const mrpt::kinematics::CVehicleVelCmd& prev_vel_cmd, const double beta, const TVelCmdParams& params) = 0;
Fields
double vel {.0}
speed(m / s)
double dir_local {.0}
: direction, relative to the current robot heading (radians).
0 means forward.
double ramp_time {.0}
: Blending time between current and target time.
double rot_speed {.0}
: (rad/s) rotational speed for rotating such as the robot slowly faces forward.
Methods
virtual size_t getVelCmdLength() const
Get number of components in each velocity command.
virtual std::string getVelCmdDescription(const int index) const
Get textual, human-readable description of each velocity command component.
virtual double getVelCmdElement(const int index) const
Get each velocity command component.
virtual void setVelCmdElement(const int index, const double val)
Set each velocity command component.
virtual bool isStopCmd() const
Returns true if the command means “do not move” / “stop”.
See also:
virtual void setToStop()
Set to a command that means “do not move” / “stop”.
See also:
virtual void cmdVel_scale(double vel_scale)
Scale the velocity command encoded in this object.
Parameters:
vel_scale |
A scale within [0,1] reflecting how much should be the raw velocity command be lessen (e.g. for safety reasons,…). |
out_vel_cmd |
Users can directly inherit from existing implementations instead of manually redefining this method: |
virtual double cmdVel_limits( const mrpt::kinematics::CVehicleVelCmd& prev_vel_cmd, const double beta, const TVelCmdParams& params )
Updates this command, computing a blended version of beta
(within [0,1]) of vel_cmd
and 1-beta
of prev_vel_cmd
, simultaneously to honoring any user-side maximum velocities.
Returns:
The [0,1] ratio that the cmdvel had to be scaled down, or 1.0 if none.