diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/include/MainWindow.h b/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/include/MainWindow.h index e498fb390025d6181946d6c4231b7c985190a94a..3a4895d9dca9ebd045651f1557998253a62db0c0 100644 --- a/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/include/MainWindow.h +++ b/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/include/MainWindow.h @@ -68,6 +68,12 @@ private slots: void on_pushButton_3_clicked(); + void on_load_yaml_button_clicked(); + + void on_en_custom_controller_clicked(); + + void on_en_safe_controller_clicked(); + private: Ui::MainWindow *ui; diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.cpp b/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.cpp index 7d2ace65fdd608f1bd7817caa0927f618bd7214f..b7637420c72a74d3b4c2700b23b1d710637d2f3d 100644 --- a/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.cpp +++ b/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.cpp @@ -313,3 +313,22 @@ void MainWindow::on_pushButton_3_clicked() this->crazyRadioCommandPublisher.publish(msg); ROS_INFO("command disconnect published"); } + +void MainWindow::on_load_yaml_button_clicked() +{ + +} + +void MainWindow::on_en_custom_controller_clicked() +{ + std_msgs::Int32 msg; + msg.data = CMD_USE_CUSTOM_CONTROLLER; + this->PPSClientCommandPublisher.publish(msg); +} + +void MainWindow::on_en_safe_controller_clicked() +{ + std_msgs::Int32 msg; + msg.data = CMD_USE_SAFE_CONTROLLER; + this->PPSClientCommandPublisher.publish(msg); +} diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.ui b/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.ui index b36fec5bd9124e3bc90d4370d48e30008cf36116..e0f50cd1bb8bb2cbdab25e7a9f51f0cd6828e2f2 100644 --- a/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.ui +++ b/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/src/MainWindow.ui @@ -320,9 +320,9 @@ </widget> </item> <item row="1" column="1"> - <widget class="QPushButton" name="pushButton"> + <widget class="QPushButton" name="en_safe_controller"> <property name="text"> - <string>Enable Controller</string> + <string>Enable Safe Controller</string> </property> </widget> </item> @@ -601,9 +601,16 @@ </widget> </item> <item row="1" column="1"> - <widget class="QPushButton" name="pushButton_2"> + <widget class="QPushButton" name="en_custom_controller"> <property name="text"> - <string>Enable Controller</string> + <string>Enable Custom Controller</string> + </property> + </widget> + </item> + <item row="1" column="0"> + <widget class="QPushButton" name="load_yaml_button"> + <property name="text"> + <string>Load YAML file</string> </property> </widget> </item> diff --git a/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/studentGUI.pro.user b/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/studentGUI.pro.user index 9e80e58b096d17c1cd875a7f8adecc2160afb02d..470dfb69f1e6c91ed5a36af4edde00f20e4011e0 100644 --- a/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/studentGUI.pro.user +++ b/pps_ws/src/d_fall_pps/GUI_Qt/studentGUI/studentGUI.pro.user @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE QtCreatorProject> -<!-- Written by QtCreator 4.0.2, 2017-08-29T16:03:13. --> +<!-- Written by QtCreator 4.0.2, 2017-08-29T18:10:33. --> <qtcreator> <data> <variable>EnvironmentId</variable> diff --git a/pps_ws/src/d_fall_pps/crazyradio/CrazyRadio.py b/pps_ws/src/d_fall_pps/crazyradio/CrazyRadio.py index db5d7c0d1bbafd1f98c7ddcdc03773d4c0628371..dd2b8629797f5b784ae4e9a5e9e6ede9b75850ce 100755 --- a/pps_ws/src/d_fall_pps/crazyradio/CrazyRadio.py +++ b/pps_ws/src/d_fall_pps/crazyradio/CrazyRadio.py @@ -292,7 +292,6 @@ if __name__ == '__main__': time.sleep(1.0) - bag.close() rospy.loginfo("bag closed") diff --git a/pps_ws/src/d_fall_pps/src/PPSClient.cpp b/pps_ws/src/d_fall_pps/src/PPSClient.cpp index 0d3fcddaee50ffa4c4981730ef826630f442835b..db9d05803ffaf2d4bed3db63390b621e1b787ba5 100755 --- a/pps_ws/src/d_fall_pps/src/PPSClient.cpp +++ b/pps_ws/src/d_fall_pps/src/PPSClient.cpp @@ -122,16 +122,18 @@ void loadSafeController() { ROS_INFO_STREAM("loaded safe controller: " << safeController.getService()); } -void loadCustomController() { +void loadCustomController() +{ ros::NodeHandle nodeHandle("~"); std::string customControllerName; - if(!nodeHandle.getParam("customController", customControllerName)) { + if(!nodeHandle.getParam("customController", customControllerName)) + { ROS_ERROR("Failed to get custom controller name"); return; } - customController = ros::service::createClient<Controller>(customControllerName, true); + customController = ros::service::createClient<Controller>(customControllerName, true); ROS_INFO_STREAM("loaded custom controller " << customControllerName); } @@ -443,11 +445,13 @@ void commandCallback(const std_msgs::Int32& commandMsg) { switch(cmd) { case CMD_USE_SAFE_CONTROLLER: + ROS_INFO("USE_SAFE_CONTROLLER Command received"); loadSafeController(); usingSafeController = true; break; case CMD_USE_CUSTOM_CONTROLLER: + ROS_INFO("USE_CUSTOM_CONTROLLER Command received"); loadCustomController(); usingSafeController = false; break;