class mrpt::kinematics::CVehicleVelCmd_Holo
Overview
Kinematic model for.
#include <mrpt/kinematics/CVehicleVelCmd_Holo.h> class CVehicleVelCmd_Holo: public mrpt::kinematics::CVehicleVelCmd { public: // typedefs typedef std::shared_ptr<mrpt::kinematics ::CVehicleVelCmd_Holo> Ptr; typedef std::shared_ptr<const mrpt::kinematics ::CVehicleVelCmd_Holo> ConstPtr; typedef std::unique_ptr<mrpt::kinematics ::CVehicleVelCmd_Holo> UniquePtr; typedef std::unique_ptr<const mrpt::kinematics ::CVehicleVelCmd_Holo> ConstUniquePtr; // fields static constexpr const char* className = "mrpt::kinematics" "::" "CVehicleVelCmd_Holo"; 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 static constexpr auto getClassName(); static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic(); static std::shared_ptr<CObject> CreateObject(); template <typename... Args> static Ptr Create(Args&&... args); template <typename Alloc, typename... Args> static Ptr CreateAlloc( const Alloc& alloc, Args&&... args ); template <typename... Args> static UniquePtr CreateUnique(Args&&... args); virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const; virtual mrpt::rtti::CObject* clone() const; 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: // typedefs typedef std::shared_ptr<CObject> Ptr; typedef std::shared_ptr<const CObject> ConstPtr; typedef std::shared_ptr<CSerializable> Ptr; typedef std::shared_ptr<const CSerializable> ConstPtr; typedef std::shared_ptr<CVehicleVelCmd> Ptr; typedef std::shared_ptr<const CVehicleVelCmd> ConstPtr; // structs struct TVelCmdParams; // methods static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic(); virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const; virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const; static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic(); virtual const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const; static const mrpt::rtti::TRuntimeClassId& GetRuntimeClassIdStatic(); 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;
Typedefs
typedef std::shared_ptr<mrpt::kinematics ::CVehicleVelCmd_Holo> Ptr
A type for the associated smart pointer.
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 const mrpt::rtti::TRuntimeClassId* GetRuntimeClass() const
Returns information about the class of an object in runtime.
virtual mrpt::rtti::CObject* clone() const
Returns a deep copy (clone) of the object, indepently of its class.
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.