39 #include <QApplication>
40 #include <rviz_rendering/render_window.hpp>
41 #include <rviz_common/tool_manager.hpp>
46 const rviz_common::ros_integration::RosNodeAbstractionIface::WeakPtr& node_abstraction,
47 const DataWarehousePtr& config_data)
50 , node_abstraction_(node_abstraction)
51 , node_(node_abstraction_.lock()->get_raw_node())
52 , config_data_(config_data)
54 logger_ = std::make_shared<rclcpp::Logger>(
node_->get_logger().get_child(
"RVizPanel"));
69 QApplication::processEvents();
79 tm->addTool(
"rviz_default_plugins/MoveCamera");
91 robot_state_display_->subProp(
"Robot State Topic")->setValue(QString::fromStdString(MOVEIT_ROBOT_STATE));
94 robot_state_display_->subProp(
"Robot Description")->setValue(QString::fromStdString(ROBOT_DESCRIPTION));
97 rviz_common::ViewController*
view =
rviz_manager_->getViewManager()->getCurrent();
98 view->subProp(
"Distance")->setValue(4.0f);
101 QVBoxLayout* rviz_layout =
new QVBoxLayout();
103 setLayout(rviz_layout);
106 auto btn_layout =
new QHBoxLayout();
107 rviz_layout->addLayout(btn_layout);
110 btn_layout->addWidget(btn =
new QCheckBox(
"visual"), 0);
111 btn->setChecked(
true);
112 connect(btn, &QCheckBox::toggled,
115 btn_layout->addWidget(btn =
new QCheckBox(
"collision"), 1);
116 btn->setChecked(
false);
117 connect(btn, &QCheckBox::toggled,
118 [
this](
bool checked) {
robot_state_display_->subProp(
"Collision Enabled")->setValue(checked); });
134 if (!urdf->isConfigured())
149 std::string frame = rm->getModelFrame();
178 if (!rm->hasJointModelGroup(group_name))
182 if (joint_model_group)
184 const std::vector<const moveit::core::LinkModel*>& link_models = joint_model_group->
getLinkModels();
186 for (std::vector<const moveit::core::LinkModel*>::const_iterator link_it = link_models.begin();
187 link_it < link_models.end(); ++link_it)
201 const std::vector<std::string>& links = rm->getLinkModelNamesWithCollisionGeometry();
216 for (std::vector<std::string>::const_iterator link_it = links.begin(); link_it < links.end(); ++link_it)
218 if ((*link_it).empty())
const std::vector< const LinkModel * > & getLinkModels() const
Get the links that are part of this joint group.
A link from the robot. Contains the constant transform applied to the link and its geometry.
const std::vector< shapes::ShapeConstPtr > & getShapes() const
Get shape associated to the collision geometry for this link.
void setVisible(bool visible)
void unsetLinkColor(const std::string &link_name)
void setLinkColor(const std::string &link_name, const QColor &color)
void highlightLinkEvent(const std::string &link_name, const QColor &color)
rviz_common::VisualizationManager * rviz_manager_
DataWarehousePtr config_data_
rclcpp::Node::SharedPtr node_
std::shared_ptr< rclcpp::Logger > logger_
void unhighlightAllEvent()
void highlightLinkSignal(const std::string &link_name, const QColor &color)
void unhighlightAllSignal()
rviz_common::ros_integration::RosNodeAbstractionIface::WeakPtr node_abstraction_
void highlightGroupEvent(const std::string &group_name)
void highlightGroupSignal(const std::string &group_name)
moveit::core::RobotModelPtr getRobotModel() const
void highlightLink(const std::string &link_name, const QColor &color)
moveit_rviz_plugin::RobotStateDisplay * robot_state_display_
RVizPanel(QWidget *parent, const rviz_common::ros_integration::RosNodeAbstractionIface::WeakPtr &node_abstraction, const DataWarehousePtr &config_data)
rviz_common::RenderPanel * rviz_render_panel_
moveit::core::RobotModelPtr getRobotModel() const