18 using namespace mvsim;
    50         const std::map<std::string, std::string> varValues = {{
"NAME", 
m_name}};
    65                         *xml_chassis, attribs, varValues,
    66                         "[DynamicsDifferential::dynamics_load_params_from_xml]");
    74                                 "[DynamicsDifferential::dynamics_load_params_from_xml]");
    78         const char* w_names[2] = {
"l_wheel", 
"r_wheel"};
    79         const double w_default_y[2] = {0.5, -0.5};
    84         for (
size_t i = 0; i < 2; i++)
   103                         if (!control_class || !control_class->
value())
   105                                         "[DynamicsDifferential] Missing 'class' attribute in "   106                                         "<controller> XML node");
   108                         const std::string sCtrlClass = std::string(control_class->
value());
   116                                         "[DynamicsDifferential] Unknown 'class'='%s' in "   117                                         "<controller> XML node",
   118                                         sCtrlClass.c_str()));
   131         const TSimulContext& context, std::vector<double>& out_torque_per_wheel)
   134         out_torque_per_wheel.assign(2, 0.0);
   166                 "The two wheels of a differential vehicle CAN'T by at the same Y "   169         const double w_veh = (w1 * R1 - w0 * R0) / Ay;
   174         odo_vel.
omega = w_veh;
 mrpt::img::TColor m_chassis_color
This file contains rapidxml parser and DOM implementation. 
void updateMaxRadiusFromPoly()
excludes the mass of wheels) 
std::map< std::string, TParamEntry > TParameterDefinitions
virtual void dynamics_load_params_from_xml(const rapidxml::xml_node< char > *xml_node) override
void parse_xmlnode_attribs(const rapidxml::xml_node< char > &xml_node, const TParameterDefinitions ¶ms, const std::map< std::string, std::string > &variableNamesValues={}, const char *functionNameContext="")
DynamicsDifferential(World *parent)
xml_node< Ch > * first_node(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const 
static const char * class_name()
virtual void invoke_motor_controllers(const TSimulContext &context, std::vector< double > &out_force_per_wheel) override
std::string BASE_IMPEXP format(const char *fmt,...) MRPT_printf_format_check(1
std::shared_ptr< ControllerBase > ControllerBasePtr
xml_attribute< Ch > * first_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const 
std::vector< Wheel > m_wheels_info
ControllerBasePtr m_controller
The installed controller. 
static const char * class_name()
virtual mrpt::math::TTwist2D getVelocityLocalOdoEstimate() const override
std::vector< b2Fixture * > m_fixture_wheels
double m_chassis_z_min
each change via updateMaxRadiusFromPoly() 
void parse_xmlnode_shape(const rapidxml::xml_node< char > &xml_node, mrpt::math::TPolygon2D &out_poly, const char *functionNameContext="")
mrpt::math::TPolygon2D m_chassis_poly
#define ASSERTMSG_(f, __ERROR_MSG)
b2Fixture * m_fixture_chassis
Created at. 
GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint GLdouble w1