1+ /* rviz_panel.hpp
2+
3+ * Copyright (C) 2023 SS47816
4+
5+ * Rviz Panel for controling goal poses
6+
7+ **/
8+
19#ifndef rviz_panel_H_
210#define rviz_panel_H_
311
412#include < ros/ros.h>
513#include < rviz/panel.h>
6-
7- /* *
14+ # include < ui_simple_panel.h >
15+ /* *
816 * Include header generated from ui file
917 * Note that you will need to use add_library function first
1018 * in order to generate the header file from ui.
1119 */
12- #include < ui_simple_panel.h>
1320
14- // Other ROS dependencies
21+ # include < std_msgs/Int16.h >
1522#include < std_msgs/String.h>
1623
1724namespace rviz_panel
1825{
19- /* *
20- * Here we declare our new subclass of rviz::Panel. Every panel which
21- * can be added via the Panels/Add_New_Panel menu is a subclass of
22- * rviz::Panel.
23- */
24-
25- class simplePanel : public rviz ::Panel
26- {
27- /* *
28- * This class uses Qt slots and is a subclass of QObject, so it needs
29- * the Q_OBJECT macro.
30- */
31- Q_OBJECT
32-
33- public:
34- #ifdef UNIT_TEST
35- friend class testClass ;
36- #endif
37- /* *
38- * QWidget subclass constructors usually take a parent widget
39- * parameter (which usually defaults to 0). At the same time,
40- * pluginlib::ClassLoader creates instances by calling the default
41- * constructor (with no arguments). Taking the parameter and giving
42- * a default of 0 lets the default constructor work and also lets
43- * someone using the class for something else to pass in a parent
44- * widget as they normally would with Qt.
45- */
46- simplePanel (QWidget * parent = 0 );
26+ class simplePanel : public rviz ::Panel
27+ {
28+ Q_OBJECT
4729
48- /* *
49- * Now we declare overrides of rviz::Panel functions for saving and
50- * loading data from the config file. Here the data is the topic name.
51- */
52- virtual void save (rviz::Config config) const ;
53- virtual void load (const rviz::Config & config);
30+ public:
31+ #ifdef UNIT_TEST
32+ friend class testClass ;
33+ #endif
34+ /* *
35+ * QWidget subclass constructors usually take a parent widget
36+ * parameter (which usually defaults to 0). At the same time,
37+ * pluginlib::ClassLoader creates instances by calling the default
38+ * constructor (with no arguments). Taking the parameter and giving
39+ * a default of 0 lets the default constructor work and also lets
40+ * someone using the class for something else to pass in a parent
41+ * widget as they normally would with Qt.
42+ */
43+ simplePanel (QWidget *parent = 0 );
5444
55- /* *
56- * Next come a couple of public Qt Slots.
57- */
58- public Q_SLOTS:
45+ /* *
46+ * Now we declare overrides of rviz::Panel functions for saving and
47+ * loading data from the config file. Here the data is the topic name.
48+ */
49+ virtual void save (rviz::Config config) const ;
50+ virtual void load (const rviz::Config &config);
5951
60- /* *
61- * Here we declare some internal slots.
62- */
63- private Q_SLOTS:
64- // Assembly Line buttons
65- void on_button_1_1_clicked ();
66- void on_button_1_2_clicked ();
67- // Packaging Area buttons
68- void on_button_2_1_clicked ();
69- void on_button_2_2_clicked ();
70- void on_button_2_3_clicked ();
71- void on_button_2_4_clicked ();
72- // Delivery Vehicle buttons
73- void on_button_3_1_clicked ();
74- void on_button_3_2_clicked ();
75- void on_button_3_3_clicked ();
52+ public Q_SLOTS:
53+ /* *
54+ * Here we declare some internal slots.
55+ */
56+ private Q_SLOTS:
57+ // Assembly Line buttons
58+ void on_button_1_1_clicked ();
59+ void on_button_1_2_clicked ();
60+ // Packaging Area buttons
61+ void on_button_2_1_clicked ();
62+ void on_button_2_2_clicked ();
63+ void on_button_2_3_clicked ();
64+ void on_button_2_4_clicked ();
65+ // Delivery Vehicle buttons
66+ void on_button_3_1_clicked ();
67+ void on_button_3_2_clicked ();
68+ void on_button_3_3_clicked ();
69+ // Contorl Buttons
70+ void on_button_regen_clicked ();
71+ void on_button_clear_clicked ();
7672
77- /* *
78- * Finally, we close up with protected member variables
79- */
80- protected:
81- // UI pointer
82- std::shared_ptr<Ui::two_button> ui_ ;
83- // ROS declaration
84- ros::NodeHandle nh_ ;
85- ros::Publisher pub_goal_ ;
86- std_msgs::String goal_name_msg_ ;
73+ protected:
74+ // UI pointer
75+ std::shared_ptr<Ui::TaskControlPanel> ui_;
76+ // ROS declaration
77+ ros::NodeHandle nh_;
78+ ros::Publisher pub_goal_ ;
79+ ros::Publisher pub_respawn_;
80+ std_msgs::String goal_name_msg_ ;
81+ std_msgs::Int16 regen_cmd_msg_ ;
82+ } ;
8783
88- };
8984} // namespace rviz_panel
9085
9186#endif
0 commit comments