Main MRPT website > C++ reference for MRPT 1.5.9
CVehicleVelCmd.cpp
Go to the documentation of this file.
1 /* +---------------------------------------------------------------------------+
2  | Mobile Robot Programming Toolkit (MRPT) |
3  | http://www.mrpt.org/ |
4  | |
5  | Copyright (c) 2005-2017, Individual contributors, see AUTHORS file |
6  | See: http://www.mrpt.org/Authors - All rights reserved. |
7  | Released under BSD License. See details in http://www.mrpt.org/License |
8  +---------------------------------------------------------------------------+ */
9 
10 #include "kinematics-precomp.h" // Precompiled header
12 #include <mrpt/utils/CStream.h>
13 
14 using namespace mrpt::kinematics;
15 using namespace mrpt::utils;
16 
18 
20 {
21 }
23 {
24  *this = other;
25 }
26 
28 {
29 }
30 
32 {
33  std::string s;
34  s += "(";
35  for (size_t i = 0; i < getVelCmdLength(); i++) {
36  s += mrpt::format("%s=%.03f ", getVelCmdDescription(i).c_str(), getVelCmdElement(i));
37  }
38  s += ")";
39  return s;
40 }
41 
43 {
44  const size_t nThis = this->getVelCmdLength();
45  ASSERTMSG_(typeid(*this) == typeid(other), "Trying to copy incompatible classes");
46  for (size_t i = 0; i < nThis; i++)
47  this->setVelCmdElement(i, other.getVelCmdElement(i) );
48  return *this;
49 }
50 
52 {
53  MRPT_LOAD_CONFIG_VAR_NO_DEFAULT(robotMax_V_mps, double, cfg, section);
54  MRPT_LOAD_HERE_CONFIG_VAR_DEGREES_NO_DEFAULT(robotMax_W_degps, double, robotMax_W_radps, cfg, section);
55  MRPT_LOAD_CONFIG_VAR(robotMinCurvRadius, double, cfg, section);
56 }
57 
59 {
60  MRPT_SAVE_CONFIG_VAR_COMMENT(robotMax_V_mps, "Max. linear speed (m/s) [Default=-1 (not set), will raise exception if needed and not set]");
61  MRPT_SAVE_CONFIG_VAR_DEGREES_COMMENT("robotMax_W_degps",robotMax_W_radps, "Max. angular speed (deg/s) [Default=-1 (not set), will raise exception if needed and not set]");
62  MRPT_SAVE_CONFIG_VAR_COMMENT(robotMinCurvRadius, "Min. radius of curvature of paths (m) [Default=-1 (not set), will raise exception if needed and not set]");
63 }
64 
65 
67  robotMax_V_mps(-1.),
68  robotMax_W_radps(-1.),
69  robotMinCurvRadius(-1.)
70 {}
71 
std::string asString() const
Returns a human readable description of the cmd.
Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
Definition: zip.h:16
The virtual base class which provides a unified interface for all persistent objects in MRPT...
Definition: CSerializable.h:39
#define MRPT_LOAD_CONFIG_VAR_NO_DEFAULT(variableName, variableType, configFileObject, sectionNameStr)
void saveToConfigFile(mrpt::utils::CConfigFileBase &c, const std::string &s) const
GLdouble s
Definition: glext.h:3602
This class allows loading and storing values and vectors of different types from a configuration text...
Virtual base for velocity commands of different kinematic models of planar mobile robot...
#define IMPLEMENTS_VIRTUAL_SERIALIZABLE(class_name, base_class_name, NameSpace)
This must be inserted as implementation of some required members for virtual CSerializable classes: ...
#define MRPT_SAVE_CONFIG_VAR_COMMENT(variableName, __comment)
void loadConfigFile(const mrpt::utils::CConfigFileBase &cfg, const std::string &section)
Load any parameter required by a CVehicleVelCmd derived class.
const GLubyte * c
Definition: glext.h:5590
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
A std::string version of C sprintf.
GLsizei const GLchar ** string
Definition: glext.h:3919
#define MRPT_LOAD_CONFIG_VAR(variableName, variableType, configFileObject, sectionNameStr)
An useful macro for loading variables stored in a INI-like file under a key with the same name that t...
#define MRPT_LOAD_HERE_CONFIG_VAR_DEGREES_NO_DEFAULT(variableName, variableType, targetVariable, configFileObject, sectionNameStr)
CVehicleVelCmd & operator=(const CVehicleVelCmd &other)
#define MRPT_SAVE_CONFIG_VAR_DEGREES_COMMENT(__entryName, __variable, __comment)
#define ASSERTMSG_(f, __ERROR_MSG)
virtual double getVelCmdElement(const int index) const =0
Get each velocity command component.



Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020