1 #ifndef MULTI_ROBOT_INFO_VISUAL_HPP
2 #define MULTI_ROBOT_INFO_VISUAL_HPP
11 #include <OgreManualObject.h>
16 #include <boost/circular_buffer.hpp>
19 #include <tuw_multi_robot_msgs/RobotInfo.h>
20 #include <tuw_multi_robot_msgs/Route.h>
21 #include <geometry_msgs/PoseWithCovariance.h>
23 #include <Eigen/Geometry>
32 using buf_type = boost::circular_buffer<geometry_msgs::PoseWithCovariance>;
37 Ogre::ColourValue
color,
38 Ogre::SceneManager *_scene_manager,
39 Ogre::SceneNode *_parent_node);
68 void updatePose(
const geometry_msgs::PoseWithCovariance &pose)
71 current_pos = Ogre::Vector3(pose.pose.position.x, pose.pose.position.y, pose.pose.position.z);
72 current_orient = Ogre::Quaternion(pose.pose.orientation.w, pose.pose.orientation.x, pose.pose.orientation.y, pose.pose.orientation.z);
84 const auto current_pose = pose.front();
85 current_pos = Ogre::Vector3(current_pose.pose.position.x,
86 current_pose.pose.position.y,
87 current_pose.pose.position.z);
90 current_pose.pose.orientation.x,
91 current_pose.pose.orientation.y,
92 current_pose.pose.orientation.z);
114 std::shared_ptr<tuw_multi_robot_msgs::Route>
route;
126 std::unique_ptr<TextVisual>
text;
149 if (
route ==
nullptr)
152 double min_dist = std::numeric_limits<double>::max();
157 const auto s =
route->segments[i];
158 const auto position_s =
s.start.position;
159 const auto position_e =
s.end.position;
160 Eigen::Vector3f ps(position_s.x, position_s.y, position_s.z);
162 double dist = dvec.norm();
173 const auto s =
route->segments[i];
174 auto position_s =
s.start.position;
181 const auto position_e =
s.end.position;
182 const double dist = pow(position_e.x - position_s.x, 2) + pow(position_e.y - position_s.y,2) + pow(position_e.z - position_s.z,2);
183 acc_len += sqrt(dist);
198 void setMessage(
const tuw_multi_robot_msgs::RobotInfoConstPtr _msg);
224 using map_type = std::map<std::string, std::shared_ptr<RobotAttributes>>;
225 using map_iterator = std::map<std::string, std::shared_ptr<RobotAttributes>>::iterator;
228 std::vector<std::string>
recycle();