MCPcopy Create free account
hub / github.com/CCNYRoboticsLab/imu_tools / processMessage

Method processMessage

rviz_imu_plugin/src/mag_display.cpp:106–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106void MagDisplay::processMessage(
107 const sensor_msgs::msg::MagneticField::ConstSharedPtr msg)
108{
109 if (!isEnabled()) return;
110
111 ++messages_received_;
112
113 std::stringstream ss;
114 ss << messages_received_ << " messages received";
115 setStatus(rviz_common::properties::StatusProperty::Ok, "Topic",
116 ss.str().c_str());
117
118 Ogre::Quaternion orientation;
119 Ogre::Vector3 position;
120 if (!context_->getFrameManager()->getTransform(
121 msg->header.frame_id, msg->header.stamp, position, orientation))
122 {
123 RVIZ_COMMON_LOG_ERROR_STREAM("Error transforming from frame '"
124 << msg->header.frame_id << "' to frame '"
125 << fixed_frame_.toStdString() << "'");
126 return;
127 }
128
129 mag_visual_->setMessage(msg);
130 mag_visual_->setFramePosition(position);
131 mag_visual_->setFrameOrientation(orientation);
132 mag_visual_->show();
133}
134
135void MagDisplay::createProperties()
136{

Callers

nothing calls this directly

Calls 4

setMessageMethod · 0.45
setFramePositionMethod · 0.45
setFrameOrientationMethod · 0.45
showMethod · 0.45

Tested by

no test coverage detected