11 #include <mrpt/opengl/CSetOfObjects.h> 12 #include <mrpt/opengl/CCylinder.h> 13 #include <mrpt/opengl/stock_objects.h> 18 #include <mrpt/version.h> 19 #if MRPT_VERSION<0x199 20 #include <mrpt/utils/TColor.h> 21 using mrpt::utils::TColor;
22 using mrpt::utils::TColorf;
23 using mrpt::utils::DEG2RAD;
25 #include <mrpt/img/TColor.h> 26 using mrpt::img::TColor;
27 using mrpt::img::TColorf;
32 using namespace mvsim;
54 auto gl_wheel = mrpt::opengl::CCylinder::Create(
56 gl_wheel->setColor(TColorf(
color));
59 0, 0.5 *
width, 0, 0, 0, DEG2RAD(90)));
61 auto gl_wheel_frame = mrpt::opengl::CSetOfObjects::Create();
62 gl_wheel_frame->insert(gl_wheel);
64 mrpt::opengl::CSetOfObjects::Ptr gl_xyz =
65 mrpt::opengl::stock_objects::CornerXYZSimple(0.9 *
diameter, 2.0);
66 gl_wheel_frame->insert(gl_xyz);
69 obj.setPose(mrpt::math::TPose3D(
x,
y, 0.5 *
diameter,
yaw, 0.0, 0.0));
71 obj.insert(gl_wheel_frame);
84 if (attr && attr->
value())
86 const std::string sAttr = attr->
value();
95 const double INERTIA_NOT_SET = -1.;
96 this->
Iyy = INERTIA_NOT_SET;
98 std::map<std::string, TParamEntry> attribs;
This file contains rapidxml parser and DOM implementation.
double width
Length(diameter) and width of the wheel rectangle [m].
void recalcInertia()
Recompute Iyy from mass, diameter and height.
void loadFromXML(const rapidxml::xml_node< char > *xml_node)
TColor color
constructor and at loadFromXML(), but can be overrided.
void getAs3DObject(mrpt::opengl::CSetOfObjects &obj)
TFSIMD_FORCE_INLINE const tfScalar & y() const
void parse_xmlnode_attribs(const rapidxml::xml_node< char > &xml_node, const std::map< std::string, TParamEntry > ¶ms, const char *function_name_context="")
double diameter
[m,rad] (in local coords)
xml_attribute< Ch > * first_attribute(const Ch *name=0, std::size_t name_size=0, bool case_sensitive=true) const
TFSIMD_FORCE_INLINE const tfScalar & x() const
vec3 parseXYPHI(const std::string &s, bool allow_missing_angle=false, double default_angle_radians=0.0)
TFSIMD_FORCE_INLINE const tfScalar & w() const