Skip to content

Commit 4e81a64

Browse files
authored
Merge pull request #4 from NUS-Advanced-Robotics-Centre/respawn_objects
New Version for Spring 2024
2 parents aba8269 + c145c53 commit 4e81a64

File tree

52 files changed

+1384
-410
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1384
-410
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ NUS ME5413 Autonomous Mobile Robotics Final Project
1010
![GitHub Repo stars](https://img.shields.io/github/stars/NUS-Advanced-Robotics-Centre/ME5413_Final_Project?color=FFE333)
1111
![GitHub Repo forks](https://img.shields.io/github/forks/NUS-Advanced-Robotics-Centre/ME5413_Final_Project?color=FFE333)
1212

13-
![cover_image](src/me5413_world/media/gazebo_world.jpg)
13+
![cover_image](src/me5413_world/media/gazebo_world.png)
1414

1515
## Dependencies
1616

@@ -164,7 +164,7 @@ roslaunch me5413_world navigation.launch
164164

165165
* From the starting point, move to the given pose within each area in sequence
166166
* Assembly Line 1, 2
167-
* Packaging Area 1, 2, 3, 4
167+
* Random Box 1, 2, 3, 4
168168
* Delivery Vehicle 1, 2, 3
169169
* We have provided you a GUI in RVIZ that allows you to click and publish these given goal poses to the `/move_base_simple/goal` topic:
170170

Lines changed: 64 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,86 @@
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

1724
namespace 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

Comments
 (0)