Skip to content

Commit

Permalink
add free-motion option to motion widget
Browse files Browse the repository at this point in the history
  • Loading branch information
steinachim committed Aug 3, 2015
1 parent d0a49db commit 6211ef5
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
3 changes: 2 additions & 1 deletion vigir_ocs_base_3d_view/src/base_3d_view.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3902,7 +3902,8 @@ void Base3DView::sendCartesianTarget(bool right_hand, std::vector<geometry_msgs:
}

cmd.use_environment_obstacle_avoidance = motion_settings.use_collision_avoidance;
cmd.planner_id = motion_settings.planner_id;
cmd.free_motion = motion_settings.free_motion;
cmd.planner_id = motion_settings.planner_id;

cmd.target_link_axis = motion_settings.target_link_axis;
cmd.orientation_type = motion_settings.orientation_type;
Expand Down
1 change: 1 addition & 0 deletions vigir_ocs_base_3d_view/src/ui/cartesian_motion_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ CartesianMotionWidget::~CartesianMotionWidget() {
void CartesianMotionWidget::getMotionSettings(CartesianMotionSettings &settings) {
settings.keep_eef_orientation = checkBox_KeepEndeffectorOrientation->isChecked();
settings.use_collision_avoidance = checkBox_CollisionAvoidance->isChecked();
settings.free_motion = checkBox_FreeMotion->isChecked();

settings.planner_id = lineEdit_CustomPlanner->text().toStdString();
settings.target_link_name = target_link_name_;
Expand Down
3 changes: 2 additions & 1 deletion vigir_ocs_base_3d_view/src/ui/cartesian_motion_widget.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace vigir_ocs {
struct CartesianMotionSettings {
bool keep_eef_orientation;
bool use_collision_avoidance;
bool free_motion;

std::string planner_id;
double sample_rate;
Expand All @@ -23,7 +24,7 @@ struct CartesianMotionSettings {

};

class CartesianMotionWidget : public QWidget, Ui::CartesianMotionWidgetUI {
class CartesianMotionWidget : public QWidget, protected Ui::CartesianMotionWidgetUI {
Q_OBJECT

public:
Expand Down
7 changes: 7 additions & 0 deletions vigir_ocs_base_3d_view/src/ui/cartesian_motion_widget.ui
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="checkBox_FreeMotion">
<property name="text">
<string>Free Motion</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
Expand Down
5 changes: 4 additions & 1 deletion vigir_ocs_base_3d_view/src/ui/circular_motion_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ void CircularMotionWidget::getMotionSettings(CircularMotionSettings &settings) {
}

void CircularMotionWidget::setupWidgets() {
checkBox_FreeMotion->setChecked(false);
checkBox_FreeMotion->hide();

QHBoxLayout *rotation_angle_layout = new QHBoxLayout();
QLabel *rotation_angle_label_ = new QLabel(tr("Rotation: "), this);

Expand All @@ -26,7 +29,7 @@ void CircularMotionWidget::setupWidgets() {

rotation_angle_layout->addWidget(rotation_angle_label_);
rotation_angle_layout->addWidget(rotation_angle_spin_, 1);
getMainLayout()->insertLayout(3, rotation_angle_layout);
layout_MainLayout->insertLayout(3, rotation_angle_layout);
adjustSize();
}

Expand Down

0 comments on commit 6211ef5

Please sign in to comment.