| 92 | } |
| 93 | |
| 94 | void MagVisual::setMessage( |
| 95 | const sensor_msgs::msg::MagneticField::ConstSharedPtr msg) |
| 96 | { |
| 97 | if (is_2d_) |
| 98 | { |
| 99 | direction_ = Ogre::Vector3(msg->magnetic_field.x, msg->magnetic_field.y, |
| 100 | 0.0); // msg->magnetic_field.z); |
| 101 | } else |
| 102 | { |
| 103 | direction_ = Ogre::Vector3(msg->magnetic_field.x, msg->magnetic_field.y, |
| 104 | msg->magnetic_field.z); |
| 105 | } |
| 106 | direction_.normalise(); |
| 107 | direction_ *= arrow_length_; |
| 108 | |
| 109 | if (heading_vector_) |
| 110 | { |
| 111 | heading_vector_->setDirection(direction_); |
| 112 | heading_vector_->set(arrow_length_ * scale_, arrow_radius_ * scale_, |
| 113 | head_length_ * scale_, head_radius_ * scale_); |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | void MagVisual::setScale(float scale) |
| 118 | { |
no outgoing calls
no test coverage detected