Skip to content
This repository was archived by the owner on Jan 7, 2023. It is now read-only.

Commit 13841c0

Browse files
authored
Merge pull request #108 from challenzhou/multi-tracking
reformat partial coding style
2 parents cd0582d + cf0c2c2 commit 13841c0

File tree

6 files changed

+18
-17
lines changed

6 files changed

+18
-17
lines changed

object_analytics_node/src/util/logger.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace diag
2222
{
2323
/*static members*/
2424
std::unordered_map<std::string, std::shared_ptr<loggerBase>>
25-
loggerFarm::loggerBaseList_{{"",nullptr}};
25+
loggerFarm::loggerBaseList_{{"", nullptr}};
2626

2727
REGISTER_LOGGER(consoleLogger);
2828

object_analytics_node/src/visualizer/control/control.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616

1717
#include <stdio.h>
1818
#include <unistd.h>
19+
#include <opencv2/core/core.hpp>
20+
#include <opencv2/opencv.hpp>
21+
1922
#include <cstring>
2023
#include <memory>
2124
#include <string>
2225

23-
#include <opencv2/core/core.hpp>
24-
#include <opencv2/opencv.hpp>
25-
2626
#include "math_sample.hpp"
2727
#include "view.hpp"
2828
#include "stream_device.hpp"

object_analytics_node/src/visualizer/control/control_ds.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#include <string>
16+
#include <memory>
17+
1518
#include "control_ds.hpp"
1619
#include "render_ellipse.hpp"
1720
#include "render_image.hpp"

object_analytics_node/src/visualizer/control/control_ds.hpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@
1616

1717
#include <stdio.h>
1818
#include <unistd.h>
19+
#include <opencv2/core/core.hpp>
20+
#include <opencv2/opencv.hpp>
21+
1922
#include <cstring>
2023
#include <memory>
2124
#include <string>
2225

23-
#include <opencv2/core/core.hpp>
24-
#include <opencv2/opencv.hpp>
25-
2626
#include "math_sample.hpp"
2727

2828
#include "utility.hpp"
@@ -70,5 +70,4 @@ class ControlDS : public Control
7070
bool StepMode_ = false;
7171
bool PauseMode_ = true;
7272
bool InitialScreen_ = true;
73-
7473
};

object_analytics_node/src/visualizer/main.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#include <stdio.h>
16+
#include <unistd.h>
17+
1518
#include <opencv2/core/core.hpp>
1619
#include <opencv2/imgproc/imgproc.hpp>
1720
#include <opencv2/opencv.hpp>
@@ -28,15 +31,10 @@
2831
#include <string>
2932
#include <memory>
3033

31-
#include <stdio.h>
32-
#include <unistd.h>
33-
3434
#include "control_ds.hpp"
3535
#include "stream_device.hpp"
3636
#include "view.hpp"
3737

38-
using namespace std;
39-
4038
static const char * keys = {
4139
"{@device_type | | camera or image files}"
4240
"{@device_path | | camera index or image path}"};
@@ -55,8 +53,8 @@ int main(int argc, char ** argv)
5553
*/
5654

5755
cv::CommandLineParser parser(argc, argv, keys);
58-
string SrcType = parser.get<string>(0);
59-
string FilePath = parser.get<string>(1);
56+
std::string SrcType = parser.get<std::string>(0);
57+
std::string FilePath = parser.get<std::string>(1);
6058

6159
/*Just hack for convinience*/
6260
std::string ds_file =

object_analytics_node/tests/unittest_tracking.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <gtest/gtest.h>
1717
#include <cassert>
1818
#include <string>
19+
#include <memory>
1920
#include "tracker/tracking.hpp"
2021

2122
TEST(UnitTestTracking, TrackingNomal) {
@@ -25,7 +26,7 @@ TEST(UnitTestTracking, TrackingNomal) {
2526
stamp.tv_nsec = 1;
2627
std::shared_ptr<sFrame> frame = std::make_shared<sFrame>(image, stamp);
2728
tracker::Tracking t(2, "cat");
28-
t.rectifyTracker(frame, cv::Rect2d(100,100,200,300));
29+
t.rectifyTracker(frame, cv::Rect2d(100, 100, 200, 300));
2930

3031
EXPECT_EQ(t.getObjName(), std::string("cat"));
3132
EXPECT_EQ(t.getTrackingId(), int32_t(2));
@@ -41,7 +42,7 @@ TEST(UnitTestTracking, TrackingNullName) {
4142
stamp.tv_nsec = 1;
4243
std::shared_ptr<sFrame> frame = std::make_shared<sFrame>(image, stamp);
4344
tracker::Tracking t(2, "");
44-
t.rectifyTracker(frame, cv::Rect2d(100,100,200,300));
45+
t.rectifyTracker(frame, cv::Rect2d(100, 100, 200, 300));
4546

4647
EXPECT_EQ(t.getObjName(), std::string(""));
4748
EXPECT_EQ(t.getTrackingId(), int32_t(2));

0 commit comments

Comments
 (0)