Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

correct "simplify widget handling" #452

Merged
merged 2 commits into from
Mar 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@

#include <rviz/display.h>
#include <rviz/selection/selection_manager.h>
#include <rviz/panel_dock_widget.h>
#include <moveit/planning_scene_rviz_plugin/planning_scene_display.h>
#include <moveit/rviz_plugin_render_tools/trajectory_visualization.h>
#include <std_msgs/String.h>
Expand Down Expand Up @@ -165,6 +166,7 @@ private Q_SLOTS:
void changedMetricsTextHeight();
void changedWorkspace();
void resetInteractiveMarkers();
void motionPanelVisibilityChange(bool enable);

protected:
enum LinkDisplayStatus
Expand Down Expand Up @@ -233,6 +235,7 @@ private Q_SLOTS:

// the planning frame
MotionPlanningFrame* frame_;
rviz::PanelDockWidget* frame_dock_;

// robot interaction
robot_interaction::RobotInteractionPtr robot_interaction_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ MotionPlanningDisplay::MotionPlanningDisplay()
, text_to_display_(NULL)
, private_handle_("~")
, frame_(NULL)
, frame_dock_(NULL)
, menu_handler_start_(new interactive_markers::MenuHandler)
, menu_handler_goal_(new interactive_markers::MenuHandler)
, int_marker_display_(NULL)
Expand Down Expand Up @@ -185,6 +186,7 @@ MotionPlanningDisplay::~MotionPlanningDisplay()

delete text_to_display_;
delete int_marker_display_;
delete frame_dock_;
}

void MotionPlanningDisplay::onInitialize()
Expand Down Expand Up @@ -224,7 +226,12 @@ void MotionPlanningDisplay::onInitialize()
// immediately switch to next trajectory display after planning
connect(frame_, SIGNAL(planningFinished()), trajectory_visual_.get(), SLOT(interruptCurrentDisplay()));

setAssociatedWidget(frame_);
if (window_context)
{
frame_dock_ = window_context->addPane("Motion Planning", frame_);
connect(frame_dock_, SIGNAL(visibilityChanged(bool)), this, SLOT(motionPanelVisibilityChange(bool)));
frame_dock_->setIcon(getIcon());
}

int_marker_display_ = context_->getDisplayFactory()->make("rviz/InteractiveMarkers");
int_marker_display_->initialize(context_);
Expand All @@ -246,6 +253,12 @@ void MotionPlanningDisplay::onInitialize()
}
}

void MotionPlanningDisplay::motionPanelVisibilityChange(bool enable)
{
if (enable)
setEnabled(true);
}

void MotionPlanningDisplay::toggleSelectPlanningGroupSubscription(bool enable)
{
if (enable)
Expand Down Expand Up @@ -1211,6 +1224,7 @@ void MotionPlanningDisplay::onEnable()

query_robot_start_->setVisible(query_start_state_property_->getBool());
query_robot_goal_->setVisible(query_goal_state_property_->getBool());
frame_->enable();

int_marker_display_->setEnabled(true);
int_marker_display_->setFixedFrame(fixed_frame_);
Expand All @@ -1227,6 +1241,7 @@ void MotionPlanningDisplay::onDisable()

query_robot_start_->setVisible(false);
query_robot_goal_->setVisible(false);
frame_->disable();
text_to_display_->setVisible(false);

PlanningSceneDisplay::onDisable();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -443,12 +443,14 @@ void MotionPlanningFrame::enable()
ui_->object_status->setText("");

// activate the frame
parentWidget()->show();
show();
}

void MotionPlanningFrame::disable()
{
move_group_.reset();
parentWidget()->hide();
hide();
}

Expand Down