Go to the documentation of this file.
10 #include <mrpt/core/lock_helper.h>
11 #include <mrpt/opengl/stock_objects.h>
12 #include <mrpt/version.h>
19 #if defined(MVSIM_HAS_ZMQ) && defined(MVSIM_HAS_PROTOBUF)
23 using namespace mvsim;
53 const mrpt::optional_ref<mrpt::opengl::COpenGLScene>& viz,
54 [[maybe_unused]]
const mrpt::optional_ref<mrpt::opengl::COpenGLScene>& physical,
55 [[maybe_unused]]
bool childrenOnly)
61 #if MRPT_VERSION >= 0x270
93 const auto globalSensorPose = p +
obs_model_.sensorPose.asTPose();
99 using mrpt::obs::CObservationIMU;
103 auto outObs = CObservationIMU::Create(
obs_model_);
106 outObs->sensorLabel =
name_;
112 outObs->set(mrpt::obs::IMU_WX, w.x);
113 outObs->set(mrpt::obs::IMU_WY, w.y);
114 outObs->set(mrpt::obs::IMU_WZ, w.z);
119 mrpt::math::TVector3D linAccNoise(0, 0, 0);
122 const mrpt::math::TVector3D linAccLocal =
125 outObs->set(mrpt::obs::IMU_X_ACC, linAccLocal.x);
126 outObs->set(mrpt::obs::IMU_Y_ACC, linAccLocal.y);
127 outObs->set(mrpt::obs::IMU_Z_ACC, linAccLocal.z);
149 using namespace std::string_literals;
153 #if defined(MVSIM_HAS_ZMQ) && defined(MVSIM_HAS_PROTOBUF)
void make_sure_we_have_a_name(const std::string &prefix)
Assign a sensible default name/sensor label if none is provided:
std::map< std::string, std::string > varValues_
Filled in by SensorBase::loadConfigFrom()
void reportNewObservation(const std::shared_ptr< mrpt::obs::CObservation > &obs, const TSimulContext &context)
mrpt::obs::CObservationIMU::Ptr last_obs_
void parse_xmlnode_children_as_param(const rapidxml::xml_node< char > &xml_node, const TParameterDefinitions ¶ms, const std::map< std::string, std::string > &variableNamesValues={}, const char *functionNameContext="", mrpt::system::COutputLogger *logger=nullptr)
void internal_simulate_imu(const TSimulContext &context)
virtual void simul_post_timestep(const TSimulContext &context) override
mrpt::math::TPose3D applyWorldRenderOffset(mrpt::math::TPose3D p) const
mrpt::poses::CPose3D getCPose3D() const
Alternative to getPose()
Simulable & vehicle_
The vehicle this sensor is attached to.
Virtual base class for all sensors.
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
mrpt::random::CRandomGenerator rng_
double get_gravity() const
void registerOnServer(mvsim::Client &c) override
bool should_simulate_sensor(const TSimulContext &context)
mrpt::opengl::CSetOfObjects::Ptr gl_sensor_origin_
void notifySimulableSetPose(const mrpt::math::TPose3D &newPose) override
mrpt::opengl::CSetOfObjects::Ptr gl_sensor_origin_corner_
double linearAccelerationStdNoise_
[m/s²]
double angularVelocityStdNoise_
[rad/s]
mrpt::Clock::time_point get_simul_timestamp() const
mrpt::obs::CObservationIMU obs_model_
std::map< std::string, TParamEntry > TParameterDefinitions
void registerOnServer(mvsim::Client &c) override
virtual void simul_post_timestep(const TSimulContext &context)
virtual void loadConfigFrom(const rapidxml::xml_node< char > *root) override
virtual void simul_pre_timestep(const TSimulContext &context) override
std::string publishTopic_
mrpt::math::TVector3D getLinearAcceleration() const
void setPose(const mrpt::math::TPose3D &p, bool notifyChange=true) const
IMU(Simulable &parent, const rapidxml::xml_node< char > *root)
virtual void loadConfigFrom(const rapidxml::xml_node< char > *root)
mrpt::math::TPose3D getPose() const
mrpt::math::TTwist2D getTwist() const
mrpt::system::CTimeLogger & getTimeLogger()
std::shared_ptr< mrpt::opengl::CSetOfObjects > glCustomVisual_
static void RegisterSensorOriginViz(const std::shared_ptr< mrpt::opengl::CSetOfObjects > &o)
mvsim
Author(s):
autogenerated on Wed May 28 2025 02:13:08