-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from NUS-Advanced-Robotics-Centre/respawn_objects
New Version for Spring 2024
- Loading branch information
Showing
52 changed files
with
1,384 additions
and
410 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
133 changes: 64 additions & 69 deletions
133
src/interactive_tools/include/interactive_tools/rviz_panel.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,86 @@ | ||
/* rviz_panel.hpp | ||
* Copyright (C) 2023 SS47816 | ||
* Rviz Panel for controling goal poses | ||
**/ | ||
|
||
#ifndef rviz_panel_H_ | ||
#define rviz_panel_H_ | ||
|
||
#include <ros/ros.h> | ||
#include <rviz/panel.h> | ||
|
||
/** | ||
#include <ui_simple_panel.h> | ||
/** | ||
* Include header generated from ui file | ||
* Note that you will need to use add_library function first | ||
* in order to generate the header file from ui. | ||
*/ | ||
#include <ui_simple_panel.h> | ||
|
||
// Other ROS dependencies | ||
#include <std_msgs/Int16.h> | ||
#include <std_msgs/String.h> | ||
|
||
namespace rviz_panel | ||
{ | ||
/** | ||
* Here we declare our new subclass of rviz::Panel. Every panel which | ||
* can be added via the Panels/Add_New_Panel menu is a subclass of | ||
* rviz::Panel. | ||
*/ | ||
|
||
class simplePanel : public rviz::Panel | ||
{ | ||
/** | ||
* This class uses Qt slots and is a subclass of QObject, so it needs | ||
* the Q_OBJECT macro. | ||
*/ | ||
Q_OBJECT | ||
|
||
public: | ||
#ifdef UNIT_TEST | ||
friend class testClass; | ||
#endif | ||
/** | ||
* QWidget subclass constructors usually take a parent widget | ||
* parameter (which usually defaults to 0). At the same time, | ||
* pluginlib::ClassLoader creates instances by calling the default | ||
* constructor (with no arguments). Taking the parameter and giving | ||
* a default of 0 lets the default constructor work and also lets | ||
* someone using the class for something else to pass in a parent | ||
* widget as they normally would with Qt. | ||
*/ | ||
simplePanel(QWidget * parent = 0); | ||
class simplePanel : public rviz::Panel | ||
{ | ||
Q_OBJECT | ||
|
||
/** | ||
* Now we declare overrides of rviz::Panel functions for saving and | ||
* loading data from the config file. Here the data is the topic name. | ||
*/ | ||
virtual void save(rviz::Config config) const; | ||
virtual void load(const rviz::Config & config); | ||
public: | ||
#ifdef UNIT_TEST | ||
friend class testClass; | ||
#endif | ||
/** | ||
* QWidget subclass constructors usually take a parent widget | ||
* parameter (which usually defaults to 0). At the same time, | ||
* pluginlib::ClassLoader creates instances by calling the default | ||
* constructor (with no arguments). Taking the parameter and giving | ||
* a default of 0 lets the default constructor work and also lets | ||
* someone using the class for something else to pass in a parent | ||
* widget as they normally would with Qt. | ||
*/ | ||
simplePanel(QWidget *parent = 0); | ||
|
||
/** | ||
* Next come a couple of public Qt Slots. | ||
*/ | ||
public Q_SLOTS: | ||
/** | ||
* Now we declare overrides of rviz::Panel functions for saving and | ||
* loading data from the config file. Here the data is the topic name. | ||
*/ | ||
virtual void save(rviz::Config config) const; | ||
virtual void load(const rviz::Config &config); | ||
|
||
/** | ||
* Here we declare some internal slots. | ||
*/ | ||
private Q_SLOTS: | ||
// Assembly Line buttons | ||
void on_button_1_1_clicked(); | ||
void on_button_1_2_clicked(); | ||
// Packaging Area buttons | ||
void on_button_2_1_clicked(); | ||
void on_button_2_2_clicked(); | ||
void on_button_2_3_clicked(); | ||
void on_button_2_4_clicked(); | ||
// Delivery Vehicle buttons | ||
void on_button_3_1_clicked(); | ||
void on_button_3_2_clicked(); | ||
void on_button_3_3_clicked(); | ||
public Q_SLOTS: | ||
/** | ||
* Here we declare some internal slots. | ||
*/ | ||
private Q_SLOTS: | ||
// Assembly Line buttons | ||
void on_button_1_1_clicked(); | ||
void on_button_1_2_clicked(); | ||
// Packaging Area buttons | ||
void on_button_2_1_clicked(); | ||
void on_button_2_2_clicked(); | ||
void on_button_2_3_clicked(); | ||
void on_button_2_4_clicked(); | ||
// Delivery Vehicle buttons | ||
void on_button_3_1_clicked(); | ||
void on_button_3_2_clicked(); | ||
void on_button_3_3_clicked(); | ||
// Contorl Buttons | ||
void on_button_regen_clicked(); | ||
void on_button_clear_clicked(); | ||
|
||
/** | ||
* Finally, we close up with protected member variables | ||
*/ | ||
protected: | ||
// UI pointer | ||
std::shared_ptr<Ui::two_button> ui_; | ||
// ROS declaration | ||
ros::NodeHandle nh_; | ||
ros::Publisher pub_goal_; | ||
std_msgs::String goal_name_msg_; | ||
protected: | ||
// UI pointer | ||
std::shared_ptr<Ui::TaskControlPanel> ui_; | ||
// ROS declaration | ||
ros::NodeHandle nh_; | ||
ros::Publisher pub_goal_; | ||
ros::Publisher pub_respawn_; | ||
std_msgs::String goal_name_msg_; | ||
std_msgs::Int16 regen_cmd_msg_; | ||
}; | ||
|
||
}; | ||
} // namespace rviz_panel | ||
|
||
#endif |
Oops, something went wrong.