MRPT  2.0.3
CVehicleVelCmd_DiffDriven.h
Go to the documentation of this file.
1 /* +------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | https://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2020, Individual contributors, see AUTHORS file |
6  | See: https://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See: https://www.mrpt.org/License |
8  +------------------------------------------------------------------------+ */
9 #pragma once
10 
12 
13 namespace mrpt::kinematics
14 {
15 /** Kinematic model for Ackermann-like or differential-driven vehicles.
16  *
17  * \ingroup mrpt_kinematics_grp
18  */
20 {
22  public:
23  /** Linear velocity (m/s) */
24  double lin_vel{.0};
25  /** Angular velocity (rad/s) */
26  double ang_vel{.0};
27 
28  ~CVehicleVelCmd_DiffDriven() override;
29  size_t getVelCmdLength() const override;
30  std::string getVelCmdDescription(const int index) const override;
31  double getVelCmdElement(const int index) const override;
32  void setVelCmdElement(const int index, const double val) override;
33  bool isStopCmd() const override;
34  void setToStop() override;
35 
36  /** See docs of method in base class. The implementation for
37  * differential-driven robots of this method
38  * just multiplies all the components of vel_cmd times vel_scale, which is
39  * appropriate
40  * for differential-driven kinematic models (v,w).
41  */
42  void cmdVel_scale(double vel_scale) override;
43 
44  /** See base class docs.
45  * Tecognizes these parameters: `robotMax_V_mps`, `robotMax_W_degps` */
46  double cmdVel_limits(
47  const mrpt::kinematics::CVehicleVelCmd& prev_vel_cmd, const double beta,
48  const TVelCmdParams& params) override;
49 
50  private:
51  double filter_max_vw(double& v, double& w, const TVelCmdParams& p);
52 };
53 
54 } // namespace mrpt::kinematics
mrpt::kinematics::CVehicleVelCmd_DiffDriven::getVelCmdDescription
std::string getVelCmdDescription(const int index) const override
Get textual, human-readable description of each velocity command component.
Definition: CVehicleVelCmd_DiffDriven.cpp:22
DEFINE_SERIALIZABLE
#define DEFINE_SERIALIZABLE(class_name, NS)
This declaration must be inserted in all CSerializable classes definition, within the class declarati...
Definition: CSerializable.h:152
mrpt::kinematics::CVehicleVelCmd_DiffDriven::getVelCmdLength
size_t getVelCmdLength() const override
Get number of components in each velocity command.
mrpt::kinematics::CVehicleVelCmd_DiffDriven::cmdVel_limits
double cmdVel_limits(const mrpt::kinematics::CVehicleVelCmd &prev_vel_cmd, const double beta, const TVelCmdParams &params) override
See base class docs.
Definition: CVehicleVelCmd_DiffDriven.cpp:101
mrpt::kinematics::CVehicleVelCmd_DiffDriven::ang_vel
double ang_vel
Angular velocity (rad/s)
Definition: CVehicleVelCmd_DiffDriven.h:26
mrpt::kinematics::CVehicleVelCmd_DiffDriven::~CVehicleVelCmd_DiffDriven
~CVehicleVelCmd_DiffDriven() override
mrpt::kinematics::CVehicleVelCmd_DiffDriven::filter_max_vw
double filter_max_vw(double &v, double &w, const TVelCmdParams &p)
Definition: CVehicleVelCmd_DiffDriven.cpp:134
mrpt::kinematics::CVehicleVelCmd_DiffDriven::setToStop
void setToStop() override
Set to a command that means "do not move" / "stop".
Definition: CVehicleVelCmd_DiffDriven.cpp:74
mrpt::kinematics::CVehicleVelCmd_DiffDriven::setVelCmdElement
void setVelCmdElement(const int index, const double val) override
Set each velocity command component.
Definition: CVehicleVelCmd_DiffDriven.cpp:53
val
int val
Definition: mrpt_jpeglib.h:957
params
mrpt::vision::TStereoCalibParams params
Definition: chessboard_stereo_camera_calib_unittest.cpp:24
mrpt::kinematics::CVehicleVelCmd_DiffDriven::cmdVel_scale
void cmdVel_scale(double vel_scale) override
See docs of method in base class.
Definition: CVehicleVelCmd_DiffDriven.cpp:95
mrpt::kinematics::CVehicleVelCmd_DiffDriven::lin_vel
double lin_vel
Linear velocity (m/s)
Definition: CVehicleVelCmd_DiffDriven.h:24
mrpt::kinematics
Definition: CKinematicChain.h:18
mrpt::kinematics::CVehicleVelCmd
Virtual base for velocity commands of different kinematic models of planar mobile robot.
Definition: CVehicleVelCmd.h:20
mrpt::kinematics::CVehicleVelCmd_DiffDriven
Kinematic model for Ackermann-like or differential-driven vehicles.
Definition: CVehicleVelCmd_DiffDriven.h:19
mrpt::kinematics::CVehicleVelCmd_DiffDriven::isStopCmd
bool isStopCmd() const override
Returns true if the command means "do not move" / "stop".
Definition: CVehicleVelCmd_DiffDriven.cpp:69
CVehicleVelCmd.h
mrpt::kinematics::CVehicleVelCmd_DiffDriven::getVelCmdElement
double getVelCmdElement(const int index) const override
Get each velocity command component.
Definition: CVehicleVelCmd_DiffDriven.cpp:38



Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Thu May 21 21:53:32 UTC 2020