Skip to content

Commit

Permalink
Note changes in rviz planning panel requiring saving (moveit#1991)
Browse files Browse the repository at this point in the history
Forward configChanged() signal from planning panel to PropertyTreeWidget.
  • Loading branch information
rhaschke committed Mar 29, 2020
1 parent 13bf03e commit 7689085
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ class MotionPlanningFrame : public QWidget

Q_SIGNALS:
void planningFinished();
void configChanged();

private Q_SLOTS:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ void MotionPlanningDisplay::onInitialize()

rviz::WindowManagerInterface* window_context = context_->getWindowManager();
frame_ = new MotionPlanningFrame(this, context_, window_context ? window_context->getParentWindow() : nullptr);
connect(frame_, SIGNAL(configChanged()), this->getModel(), SIGNAL(configChanged()));
resetStatusTextColor();
addStatusText("Initialized.");

Expand Down Expand Up @@ -1325,27 +1326,26 @@ void MotionPlanningDisplay::load(const rviz::Config& config)
int attempts;
if (config.mapGetInt("MoveIt_Planning_Attempts", &attempts))
frame_->ui_->planning_attempts->setValue(attempts);
if (config.mapGetFloat("Velocity_Scaling_Factor", &d))
frame_->ui_->velocity_scaling_factor->setValue(d);
if (config.mapGetFloat("Acceleration_Scaling_Factor", &d))
frame_->ui_->acceleration_scaling_factor->setValue(d);
if (config.mapGetFloat("MoveIt_Goal_Tolerance", &d))
frame_->ui_->goal_tolerance->setValue(d);

bool b;
if (config.mapGetBool("MoveIt_Allow_Replanning", &b))
frame_->ui_->allow_replanning->setChecked(b);
if (config.mapGetBool("MoveIt_Allow_Sensor_Positioning", &b))
frame_->ui_->allow_looking->setChecked(b);
if (config.mapGetBool("MoveIt_Allow_External_Program", &b))
frame_->ui_->allow_external_program->setChecked(b);
if (config.mapGetBool("MoveIt_Use_Cartesian_Path", &b))
frame_->ui_->use_cartesian_path->setChecked(b);
if (config.mapGetBool("MoveIt_Use_Constraint_Aware_IK", &b))
frame_->ui_->collision_aware_ik->setChecked(b);
if (config.mapGetBool("MoveIt_Allow_Approximate_IK", &b))
frame_->ui_->approximate_ik->setChecked(b);
if (config.mapGetBool("MoveIt_Allow_External_Program", &b))
frame_->ui_->allow_external_program->setChecked(b);
if (config.mapGetBool("MoveIt_Allow_Replanning", &b))
frame_->ui_->allow_replanning->setChecked(b);
if (config.mapGetBool("MoveIt_Allow_Sensor_Positioning", &b))
frame_->ui_->allow_looking->setChecked(b);

float v;
if (config.mapGetFloat("Velocity_Scaling_Factor", &v))
frame_->ui_->velocity_scaling_factor->setValue(v);
if (config.mapGetFloat("Acceleration_Scaling_Factor", &v))
frame_->ui_->acceleration_scaling_factor->setValue(v);

rviz::Config workspace = config.mapGetChild("MoveIt_Workspace");
rviz::Config ws_center = workspace.mapGetChild("Center");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,31 @@ MotionPlanningFrame::MotionPlanningFrame(MotionPlanningDisplay* pdisplay, rviz::

connect(ui_->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int)));

/* Notice changes to be safed in config file */
connect(ui_->database_host, SIGNAL(textChanged(QString)), this, SIGNAL(configChanged()));
connect(ui_->database_port, SIGNAL(valueChanged(int)), this, SIGNAL(configChanged()));

connect(ui_->goal_tolerance, SIGNAL(valueChanged(double)), this, SIGNAL(configChanged()));

connect(ui_->planning_time, SIGNAL(valueChanged(double)), this, SIGNAL(configChanged()));
connect(ui_->planning_attempts, SIGNAL(valueChanged(double)), this, SIGNAL(configChanged()));
connect(ui_->velocity_scaling_factor, SIGNAL(valueChanged(double)), this, SIGNAL(configChanged()));
connect(ui_->acceleration_scaling_factor, SIGNAL(valueChanged(double)), this, SIGNAL(configChanged()));

connect(ui_->allow_replanning, SIGNAL(stateChanged(int)), this, SIGNAL(configChanged()));
connect(ui_->allow_looking, SIGNAL(stateChanged(int)), this, SIGNAL(configChanged()));
connect(ui_->allow_external_program, SIGNAL(stateChanged(int)), this, SIGNAL(configChanged()));
connect(ui_->use_cartesian_path, SIGNAL(stateChanged(int)), this, SIGNAL(configChanged()));
connect(ui_->collision_aware_ik, SIGNAL(stateChanged(int)), this, SIGNAL(configChanged()));
connect(ui_->approximate_ik, SIGNAL(stateChanged(int)), this, SIGNAL(configChanged()));

connect(ui_->wcenter_x, SIGNAL(valueChanged(double)), this, SIGNAL(configChanged()));
connect(ui_->wcenter_y, SIGNAL(valueChanged(double)), this, SIGNAL(configChanged()));
connect(ui_->wcenter_z, SIGNAL(valueChanged(double)), this, SIGNAL(configChanged()));
connect(ui_->wsize_x, SIGNAL(valueChanged(double)), this, SIGNAL(configChanged()));
connect(ui_->wsize_y, SIGNAL(valueChanged(double)), this, SIGNAL(configChanged()));
connect(ui_->wsize_z, SIGNAL(valueChanged(double)), this, SIGNAL(configChanged()));

QShortcut* copy_object_shortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_C), ui_->collision_objects_list);
connect(copy_object_shortcut, SIGNAL(activated()), this, SLOT(copySelectedCollisionObject()));

Expand Down

0 comments on commit 7689085

Please sign in to comment.