Go to the documentation of this file.
32 #include <OGRE/OgreSceneManager.h>
33 #include <OGRE/OgreSceneNode.h>
47 const std::string& link_name,
48 const std::string& text,
50 display->
setStatus(level, QString::fromStdString(link_name),
51 QString::fromStdString(text));
55 :
Display(), has_new_transforms_(false), time_since_last_transform_(0.0
f) {
58 "Whether to display the visual representation of the robot.",
62 "Collision Enabled",
false,
63 "Whether to display the collision representation of the robot.",
this,
68 "Interval at which to update the links, in seconds. "
69 "0 means to update every update cycle.",
75 "Alpha", 1,
"Amount of transparency to apply to the links.",
this,
82 "Robot Model normally assumes the link name is the "
83 "same as the tf frame name. "
84 " This option allows you to set a prefix. Mainly "
85 "useful for multi-robot situations.",
96 for (std::map<std::string, rviz::RobotPtr>::iterator it =
humans_.begin();
109 for (std::map<std::string, rviz::RobotPtr>::iterator it =
humans_.begin();
111 if(it->second !=
nullptr)
117 for (std::map<std::string, rviz::RobotPtr>::iterator it =
humans_.begin();
119 if(it->second !=
nullptr)
125 for (std::map<std::string, rviz::RobotPtr>::iterator it =
humans_.begin();
127 if(it->second !=
nullptr)
128 it->second->setVisualVisible(
139 std::map<std::string, rviz::RobotPtr>::iterator it) {
142 std::string
description =
"human_description_" + (it->first);
157 QString(
"Parameter [%1] does not exist, and was not found by "
166 QString(
"Invalid parameter name: %1.\n%2")
167 .arg(QString::fromStdString(
description), e.what()));
171 if (content.empty()) {
177 std::string robot_description = content;
189 it->second->load(descr);
198 for (std::map<std::string, rviz::RobotPtr>::iterator it =
humans_.begin();
200 if(it->second !=
nullptr)
201 it->second->setVisible(
true);
207 for (std::map<std::string, rviz::RobotPtr>::iterator it =
humans_.begin();
209 if(it->second !=
nullptr)
210 it->second->setVisible(
false);
221 for (std::map<std::string, rviz::RobotPtr>::iterator it =
humans_.begin(); it !=
humans_.end(); it++){
222 if(it->second !=
nullptr){
240 for (std::map<std::string, rviz::RobotPtr>::iterator it =
humans_.begin();
242 if(it->second !=
nullptr)
260 std::map<std::string, rviz::RobotPtr>::iterator itH;
262 if (std::find(
ids_.begin(),
ids_.end(), itH->first) ==
ids_.end()) {
264 itH->second =
nullptr;
274 for (
const auto&
id :
ids_) {
277 std::string human_description =
"human_description_"+id;
279 auto ins =
humans_.insert(std::pair<std::string, rviz::RobotPtr>(
id,
nullptr));
void onDisable() override
void update(float wall_dt, float ros_dt) override
void initializeRobot(std::map< std::string, RobotPtr >::iterator it)
virtual void queueRender()=0
StringProperty * tf_prefix_property_
void updateCollisionVisible()
bool getParam(const std::string &key, bool &b) const
virtual void clearStatuses()
Property * collision_enabled_property_
virtual QVariant getValue() const
void linkUpdaterStatusFunction(StatusProperty::Level level, const std::string &link_name, const std::string &text, RobotModelDisplay *display)
virtual void setStatus(StatusProperty::Level level, const QString &name, const QString &text)
FloatProperty * alpha_property_
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)
virtual float getFloat() const
Property(const QString &name, const QVariant &default_value, const QString &description, P *parent, Func &&changed_slot)
Ogre::SceneNode * scene_node_
std::string getStdString()
bool searchParam(const std::string &key, std::string &result) const
float time_since_last_transform_
bool hasParam(const std::string &key) const
Subscriber subscribe(const std::string &topic, uint32_t queue_size, const boost::function< void(C)> &callback, const VoidConstPtr &tracked_object=VoidConstPtr(), const TransportHints &transport_hints=TransportHints())
URDF_EXPORT bool initString(const std::string &xmlstring)
virtual FrameManager * getFrameManager() const=0
Property * visual_enabled_property_
std::map< std::string, RobotPtr > humans_
void fixedFrameChanged() override
void onEnable() override
Loads a URDF from the ros-param named by our "Robot Description" property, iterates through the links...
DisplayContext * context_
std::string robot_description_
void idsCallback(const hri_msgs::IdsListConstPtr &msg)
FloatProperty * update_rate_property_
void onInitialize() override
void updateVisualVisible()
std::shared_ptr< Robot > RobotPtr
Uses a robot xml description to display the pieces of a robot at the transforms broadcast by rosTF.
std::vector< std::string > ids_
ros::NodeHandle update_nh_
~HumansModelDisplay() override
hri_rviz
Author(s): Lorenzo Ferrini, Séverin Lemaignan
autogenerated on Fri Oct 20 2023 02:53:21