30 std::vector<std::string> mark_for_deletion;
34 auto dur = ts_now - elem.second;
37 mark_for_deletion.push_back(elem.first);
41 for (
const std::string &elem : mark_for_deletion)
55 auto it_rcle = recycle_map_.find(elem);
56 if (it_rcle != recycle_map_.end())
58 recycle_map_.erase(it_rcle);
62 return std::move(mark_for_deletion);
95 arrow_ptr->
setScale(Ogre::Vector3(1,1,1));
124 Ogre::Quaternion orient_x = Ogre::Quaternion(Ogre::Radian(-Ogre::Math::HALF_PI), Ogre::Vector3::UNIT_Y);
128 return std::vector<rviz::Object*>{ arrow_ptr };
141 const auto pose = it->second.front().pose;
143 if (pose.position.x == 0 && pose.position.y == 0 && pose.position.z == 0)
145 Ogre::Vector3 position(pose.position.x, pose.position.y, pose.position.z);
146 Ogre::Quaternion orientation(pose.orientation.w,
155 std::vector<rviz::Object*>>(
159 for (
int ii = 0; ii < it_arrows->second.size(); ++ii)
162 if (dynamic_cast<rviz::Arrow*>(r_obj))
164 Ogre::Quaternion orient_x = Ogre::Quaternion(Ogre::Radian(-Ogre::Math::HALF_PI), Ogre::Vector3::UNIT_Y);
191 it->second.push_front(_msg->pose);
239 for (
auto &renderings : it.second)
241 renderings->setScale(Ogre::Vector3(scale,scale,scale));
250 for (
auto &renderings : it.second)
252 renderings->setColor(color.r,color.g,color.b,color.a);
void setScalePose(float scale)
recycle_map_type recycle_map_
ros::Time last_render_time_
std::vector< std::string > recycle()
void enableRobot(const std::string &rName)
virtual void setPosition(const Ogre::Vector3 &position)=0
void setMessage(const tuw_multi_robot_msgs::RobotInfoConstPtr _msg)
virtual void setOrientation(const Ogre::Quaternion &orientation)=0
void resetKeepMeasurementsCount(const unsigned int c)
ros::Duration recycle_thresh_
virtual ~MultiRobotInfoVisual()
virtual void setScale(const Ogre::Vector3 &scale)=0
void disableRobot(const std::string &rName)
std::vector< rviz::Object * > make_robot(Ogre::Vector3 &position, Ogre::Quaternion &orientation)
void setColorPose(Ogre::ColourValue color)
std::set< std::string > disabled_robots_
void setFramePosition(const Ogre::Vector3 &_position)
Ogre::SceneNode * frame_node_
Ogre::SceneManager * scene_manager_
std::pair< std::string, boost::circular_buffer< geometry_msgs::PoseWithCovariance >> internal_map_type
MultiRobotInfoVisual(Ogre::SceneManager *_scene_manager, Ogre::SceneNode *_parent_node)
virtual void setColor(float r, float g, float b, float a)=0
std::map< std::string, boost::circular_buffer< geometry_msgs::PoseWithCovariance >>::iterator map_iterator
std::map< std::string, std::vector< rviz::Object * > > robot_renderings_map_
void resetDuration(const ros::Duration &ts)
ros::Duration render_dur_thresh_
void setFrameOrientation(const Ogre::Quaternion &orientation)