10 from python_qt_binding.QtCore
import Qt, Slot, QAbstractListModel
11 from python_qt_binding.QtGui
import QWidget, QHBoxLayout, QVBoxLayout, QCheckBox, QLabel, QListWidget, QPushButton, QDoubleSpinBox, QFrame
13 from vigir_footstep_planning_msgs.msg
import PatternGeneratorParameters
22 super(PatternGeneratorDialog, self).
__init__(context)
23 self.setObjectName(
'PatternGeneratorDialog')
28 context.add_widget(self.
_parent)
31 self._widget.shutdown_plugin()
36 enable_pattern_generator =
False 39 super(PatternGeneratorWidget, self).
__init__()
51 left_vbox = QVBoxLayout()
54 start_command = QPushButton(
"Start")
55 left_vbox.addWidget(start_command)
59 self.simulation_mode_checkbox.setText(
"Simulation Mode")
60 self.simulation_mode_checkbox.setChecked(
False)
65 self.realtime_mode_checkbox.setText(
"Realtime Mode")
66 self.realtime_mode_checkbox.setChecked(
False)
71 self.joystick_mode_checkbox.setText(
"Joystick Mode")
72 self.joystick_mode_checkbox.setChecked(
False)
77 self.ignore_invalid_steps_checkbox.setText(
"Ignore Invalid Steps")
78 self.ignore_invalid_steps_checkbox.setChecked(
False)
84 add_widget_with_frame(left_vbox, self.
foot_seperation,
"Foot Seperation (m):")
87 self.
delta_x = generate_q_double_spin_box(0.0, -0.4, 0.4, 2, 0.01)
89 add_widget_with_frame(left_vbox, self.
delta_x,
"dX (m):")
92 self.
delta_y = generate_q_double_spin_box(0.0, -2.2, 2.2, 2, 0.01)
94 add_widget_with_frame(left_vbox, self.
delta_y,
"dY (m):")
97 self.
delta_yaw = generate_q_double_spin_box(0.0, -30.0, 30.0, 0, 1.0)
99 add_widget_with_frame(left_vbox, self.
delta_yaw,
"dYaw (deg):")
102 self.
roll = generate_q_double_spin_box(0.0, -30.0, 30.0, 0, 1.0)
104 add_widget_with_frame(left_vbox, self.
roll,
"Roll (deg):")
107 self.
pitch = generate_q_double_spin_box(0.0, -30.0, 30.0, 0, 1.0)
109 add_widget_with_frame(left_vbox, self.
pitch,
"Pitch (deg):")
112 left_vbox.addStretch()
113 hbox.addLayout(left_vbox, 1)
116 right_vbox = QVBoxLayout()
119 stop_command = QPushButton(
"Stop")
120 right_vbox.addWidget(stop_command)
124 self.collision_checkbox.setText(
"Ignore Collision")
125 self.collision_checkbox.setChecked(
True)
130 self.override_checkbox.setText(
"Override 3D")
131 self.override_checkbox.setChecked(
False)
135 right_vbox.addStretch()
136 hbox.addLayout(right_vbox, 1)
148 widget.setLayout(vbox)
158 print "Shutting down ..." 159 self.pattern_generator_params_pub.unregister()
164 params = PatternGeneratorParameters()
167 params.simulation_mode = self.simulation_mode_checkbox.isChecked()
168 params.joystick_mode = self.joystick_mode_checkbox.isChecked()
169 params.ignore_invalid_steps = self.ignore_invalid_steps_checkbox.isChecked()
170 params.d_step.position.x = self.delta_x.value()
171 params.d_step.position.y = self.delta_y.value()
172 params.d_step.position.z = 0
173 q = tf.transformations.quaternion_from_euler(math.radians(self.roll.value()), math.radians(self.pitch.value()), math.radians(self.delta_yaw.value()))
174 params.d_step.orientation.x = q[0]
175 params.d_step.orientation.y = q[1]
176 params.d_step.orientation.z = q[2]
177 params.d_step.orientation.w = q[3]
178 params.foot_seperation = self.foot_seperation.value()
179 params.parameter_set_name.data = self.parameter_set_widget.current_parameter_set_name()
181 print "Send stepping command = \n",params
182 self.pattern_generator_params_pub.publish(params)
194 if self.realtime_mode_checkbox.isChecked():