Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mvsim::IMU Class Reference

An Inertial Measurement Unit (IMU) sensor. More...

#include <IMU.h>

Inheritance diagram for mvsim::IMU:
Inheritance graph
[legend]

Public Member Functions

 IMU (Simulable &parent, const rapidxml::xml_node< char > *root)
 
virtual void loadConfigFrom (const rapidxml::xml_node< char > *root) override
 
void registerOnServer (mvsim::Client &c) override
 
virtual void simul_post_timestep (const TSimulContext &context) override
 
virtual void simul_pre_timestep (const TSimulContext &context) override
 
virtual ~IMU ()
 
- Public Member Functions inherited from mvsim::SensorBase
void registerOnServer (mvsim::Client &c) override
 
double sensor_period () const
 
 SensorBase (Simulable &vehicle)
 
virtual void simulateOn3DScene ([[maybe_unused]] mrpt::opengl::COpenGLScene &gl_scene)
 
virtual ~SensorBase ()
 
- Public Member Functions inherited from mvsim::VisualObject
const std::optional< Shape2p5 > & collisionShape () const
 
void customVisualVisible (const bool visible)
 
bool customVisualVisible () const
 
virtual void guiUpdate (const mrpt::optional_ref< mrpt::opengl::COpenGLScene > &viz, const mrpt::optional_ref< mrpt::opengl::COpenGLScene > &physical)
 
Worldparent ()
 
const Worldparent () const
 
void showCollisionShape (bool show)
 
 VisualObject (World *parent, bool insertCustomVizIntoViz=true, bool insertCustomVizIntoPhysical=true)
 
virtual ~VisualObject ()
 
- Public Member Functions inherited from mvsim::Simulable
virtual void apply_force (const mrpt::math::TVector2D &force, const mrpt::math::TPoint2D &applyPoint=mrpt::math::TPoint2D(0, 0))
 
const b2Bodyb2d_body () const
 
b2Bodyb2d_body ()
 
virtual void freeOpenGLResources ()
 
mrpt::poses::CPose2D getCPose2D () const
 Alternative to getPose() More...
 
mrpt::poses::CPose3D getCPose3D () const
 Alternative to getPose() More...
 
mrpt::math::TVector3D getLinearAcceleration () const
 
const std::string & getName () const
 
mrpt::math::TPose3D getPose () const
 
mrpt::math::TPose3D getPoseNoLock () const
 No thread-safe version. Used internally only. More...
 
WorldgetSimulableWorldObject ()
 
const WorldgetSimulableWorldObject () const
 
mrpt::math::TTwist2D getTwist () const
 
mrpt::math::TTwist2D getVelocityLocal () const
 
bool hadCollision () const
 
bool isInCollision () const
 
virtual VisualObjectmeAsVisualObject ()
 
void resetCollisionFlag ()
 
void setName (const std::string &s)
 
void setPose (const mrpt::math::TPose3D &p) const
 
void setTwist (const mrpt::math::TTwist2D &dq) const
 
 Simulable (World *parent)
 

Protected Member Functions

void internal_simulate_imu (const TSimulContext &context)
 
void internalGuiUpdate (const mrpt::optional_ref< mrpt::opengl::COpenGLScene > &viz, [[maybe_unused]] const mrpt::optional_ref< mrpt::opengl::COpenGLScene > &physical, [[maybe_unused]] bool childrenOnly) override
 
- Protected Member Functions inherited from mvsim::SensorBase
void make_sure_we_have_a_name (const std::string &prefix)
 Assign a sensible default name/sensor label if none is provided: More...
 
bool parseSensorPublish (const rapidxml::xml_node< char > *node, const std::map< std::string, std::string > &varValues)
 
void reportNewObservation (const std::shared_ptr< mrpt::obs::CObservation > &obs, const TSimulContext &context)
 
void reportNewObservation_lidar_2d (const std::shared_ptr< mrpt::obs::CObservation2DRangeScan > &obs, const TSimulContext &context)
 
bool should_simulate_sensor (const TSimulContext &context)
 
Worldworld ()
 
const Worldworld () const
 
- Protected Member Functions inherited from mvsim::VisualObject
void addCustomVisualization (const mrpt::opengl::CRenderizable::Ptr &glModel, const mrpt::poses::CPose3D &modelPose={}, const float modelScale=1.0f, const std::string &modelName="group", const std::optional< std::string > &modelURI=std::nullopt, const bool initialShowBoundingBox=false)
 
virtual void internalGuiUpdate (const mrpt::optional_ref< mrpt::opengl::COpenGLScene > &viz, const mrpt::optional_ref< mrpt::opengl::COpenGLScene > &physical, bool childrenOnly=false)=0
 
bool parseVisual (const rapidxml::xml_node< char > &rootNode)
 Returns true if there is at least one <visual>...</visual> entry. More...
 
bool parseVisual (const JointXMLnode<> &rootNode)
 
void setCollisionShape (const Shape2p5 &cs)
 

Protected Attributes

double angularVelocityStdNoise_ = 2e-4
 [rad/s] More...
 
mrpt::opengl::CSetOfObjects::Ptr gl_sensor_origin_
 
mrpt::opengl::CSetOfObjects::Ptr gl_sensor_origin_corner_
 
mrpt::obs::CObservationIMU::Ptr last_obs_
 
std::mutex last_obs_cs_
 
double linearAccelerationStdNoise_ = 0.017
 [m/s²] More...
 
mrpt::obs::CObservationIMU obs_model_
 
mrpt::random::CRandomGenerator rng_
 
- Protected Attributes inherited from mvsim::SensorBase
std::string publishTopic_
 
std::shared_ptr< mrpt::io::CFileGZOutputStream > rawlog_io_
 
std::string save_to_rawlog_
 
double sensor_last_timestamp_ = 0
 
double sensor_period_ = 0.1
 
std::map< std::string, std::string > varValues_
 Filled in by SensorBase::loadConfigFrom() More...
 
Simulablevehicle_
 The vehicle this sensor is attached to. More...
 
- Protected Attributes inherited from mvsim::VisualObject
std::shared_ptr< mrpt::opengl::CSetOfObjects > glCollision_
 
std::shared_ptr< mrpt::opengl::CSetOfObjects > glCustomVisual_
 
int32_t glCustomVisualId_ = -1
 
const bool insertCustomVizIntoPhysical_ = true
 
const bool insertCustomVizIntoViz_ = true
 
Worldworld_
 
- Protected Attributes inherited from mvsim::Simulable
std::string name_
 

Additional Inherited Members

- Public Types inherited from mvsim::SensorBase
using Ptr = std::shared_ptr< SensorBase >
 
- Public Types inherited from mvsim::Simulable
using Ptr = std::shared_ptr< Simulable >
 
- Static Public Member Functions inherited from mvsim::SensorBase
static SensorBase::Ptr factory (Simulable &parent, const rapidxml::xml_node< char > *xml_node)
 
static std::shared_ptr< mrpt::opengl::CSetOfObjects > GetAllSensorsFOVViz ()
 
static std::shared_ptr< mrpt::opengl::CSetOfObjects > GetAllSensorsOriginViz ()
 
static void RegisterSensorFOVViz (const std::shared_ptr< mrpt::opengl::CSetOfObjects > &o)
 
static void RegisterSensorOriginViz (const std::shared_ptr< mrpt::opengl::CSetOfObjects > &o)
 
- Static Public Member Functions inherited from mvsim::VisualObject
static void FreeOpenGLResources ()
 
- Static Public Attributes inherited from mvsim::VisualObject
static double GeometryEpsilon = 1e-3
 

Detailed Description

An Inertial Measurement Unit (IMU) sensor.

Definition at line 25 of file IMU.h.

Constructor & Destructor Documentation

◆ IMU()

IMU::IMU ( Simulable parent,
const rapidxml::xml_node< char > *  root 
)

Definition at line 26 of file IMU.cpp.

◆ ~IMU()

IMU::~IMU ( )
virtual

Definition at line 32 of file IMU.cpp.

Member Function Documentation

◆ internal_simulate_imu()

void IMU::internal_simulate_imu ( const TSimulContext context)
protected

Definition at line 97 of file IMU.cpp.

◆ internalGuiUpdate()

void IMU::internalGuiUpdate ( const mrpt::optional_ref< mrpt::opengl::COpenGLScene > &  viz,
[[maybe_unused] ] const mrpt::optional_ref< mrpt::opengl::COpenGLScene > &  physical,
[[maybe_unused] ] bool  childrenOnly 
)
overrideprotected

Definition at line 55 of file IMU.cpp.

◆ loadConfigFrom()

void IMU::loadConfigFrom ( const rapidxml::xml_node< char > *  root)
overridevirtual

Loads the parameters common to all sensors. Should be overriden, and they call to this base method.

Reimplemented from mvsim::SensorBase.

Definition at line 34 of file IMU.cpp.

◆ registerOnServer()

void IMU::registerOnServer ( mvsim::Client c)
overridevirtual

Reimplemented from mvsim::Simulable.

Definition at line 141 of file IMU.cpp.

◆ simul_post_timestep()

void IMU::simul_post_timestep ( const TSimulContext context)
overridevirtual

Override to do any required process right after the integration of dynamic equations for each timestep. IMPORTANT: Reimplementations MUST also call this base method, since it is in charge of important tasks (e.g. update q_, dq_)

Reimplemented from mvsim::Simulable.

Definition at line 87 of file IMU.cpp.

◆ simul_pre_timestep()

void IMU::simul_pre_timestep ( const TSimulContext context)
overridevirtual

Process right before the integration of dynamic equations for each timestep: set action forces from motors, update friction models, etc.

Reimplemented from mvsim::Simulable.

Definition at line 84 of file IMU.cpp.

Member Data Documentation

◆ angularVelocityStdNoise_

double mvsim::IMU::angularVelocityStdNoise_ = 2e-4
protected

[rad/s]

Definition at line 49 of file IMU.h.

◆ gl_sensor_origin_

mrpt::opengl::CSetOfObjects::Ptr mvsim::IMU::gl_sensor_origin_
protected

Definition at line 61 of file IMU.h.

◆ gl_sensor_origin_corner_

mrpt::opengl::CSetOfObjects::Ptr mvsim::IMU::gl_sensor_origin_corner_
protected

Definition at line 61 of file IMU.h.

◆ last_obs_

mrpt::obs::CObservationIMU::Ptr mvsim::IMU::last_obs_
protected

Last simulated obs

Definition at line 59 of file IMU.h.

◆ last_obs_cs_

std::mutex mvsim::IMU::last_obs_cs_
protected

Definition at line 56 of file IMU.h.

◆ linearAccelerationStdNoise_

double mvsim::IMU::linearAccelerationStdNoise_ = 0.017
protected

[m/s²]

Definition at line 50 of file IMU.h.

◆ obs_model_

mrpt::obs::CObservationIMU mvsim::IMU::obs_model_
protected

Definition at line 54 of file IMU.h.

◆ rng_

mrpt::random::CRandomGenerator mvsim::IMU::rng_
protected

Definition at line 64 of file IMU.h.


The documentation for this class was generated from the following files:


mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:23