diff --git a/object_analytics_node/include/object_analytics_node/tracker/trackerKCF.hpp b/object_analytics_node/include/object_analytics_node/tracker/trackerKCF.hpp index ac0100f..374956e 100644 --- a/object_analytics_node/include/object_analytics_node/tracker/trackerKCF.hpp +++ b/object_analytics_node/include/object_analytics_node/tracker/trackerKCF.hpp @@ -231,7 +231,7 @@ class TrackerKCFImpl cv::Mat hann; // 10 dimensional hann-window filter for CN features cv::Mat hann_cn; - + // training response and its FFT cv::Mat y, yf; // observation and its FFT diff --git a/object_analytics_node/src/visualizer/control/control.hpp b/object_analytics_node/src/visualizer/control/control.hpp index b535484..041f130 100644 --- a/object_analytics_node/src/visualizer/control/control.hpp +++ b/object_analytics_node/src/visualizer/control/control.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__CONTROL__CONTROL_HPP_ +#define VISUALIZER__CONTROL__CONTROL_HPP_ #include #include @@ -66,3 +67,4 @@ class Control View::Ptr DataView_ = nullptr; stream_device::Ptr StreamDev_ = nullptr; }; +#endif // VISUALIZER__CONTROL__CONTROL_HPP_ diff --git a/object_analytics_node/src/visualizer/control/control_ds.hpp b/object_analytics_node/src/visualizer/control/control_ds.hpp index e652438..d471401 100644 --- a/object_analytics_node/src/visualizer/control/control_ds.hpp +++ b/object_analytics_node/src/visualizer/control/control_ds.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__CONTROL__CONTROL_DS_HPP_ +#define VISUALIZER__CONTROL__CONTROL_DS_HPP_ #include #include @@ -71,3 +72,4 @@ class ControlDS : public Control bool PauseMode_ = true; bool InitialScreen_ = true; }; +#endif // VISUALIZER__CONTROL__CONTROL_DS_HPP_ diff --git a/object_analytics_node/src/visualizer/data/dataset/track_dataset.hpp b/object_analytics_node/src/visualizer/data/dataset/track_dataset.hpp index 26f0553..7216f45 100644 --- a/object_analytics_node/src/visualizer/data/dataset/track_dataset.hpp +++ b/object_analytics_node/src/visualizer/data/dataset/track_dataset.hpp @@ -12,8 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#ifndef OBJECT_ANALYTICS_NODE__DATASET__TRACK_DATASET_HPP_ -#define OBJECT_ANALYTICS_NODE__DATASET__TRACK_DATASET_HPP_ +#ifndef VISUALIZER__DATA__DATASET__TRACK_DATASET_HPP_ +#define VISUALIZER__DATA__DATASET__TRACK_DATASET_HPP_ #include #include @@ -205,5 +205,4 @@ class imgMTDataset : public trDataset }; } // namespace datasets - -#endif // OBJECT_ANALYTICS_NODE__DATASET__TRACK_DATASET_HPP_ _ +#endif // VISUALIZER__DATA__DATASET__TRACK_DATASET_HPP_ diff --git a/object_analytics_node/src/visualizer/data/dataset/trimg_dataset.cpp b/object_analytics_node/src/visualizer/data/dataset/trimg_dataset.cpp index 4845791..e5a7800 100644 --- a/object_analytics_node/src/visualizer/data/dataset/trimg_dataset.cpp +++ b/object_analytics_node/src/visualizer/data/dataset/trimg_dataset.cpp @@ -12,8 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include "track_dataset.hpp" - #include #include @@ -21,6 +19,8 @@ #include #include +#include "track_dataset.hpp" + namespace datasets { void imgDataset::load(const std::string & rootPath) diff --git a/object_analytics_node/src/visualizer/data/frame.hpp b/object_analytics_node/src/visualizer/data/frame.hpp index 75bce56..6824420 100644 --- a/object_analytics_node/src/visualizer/data/frame.hpp +++ b/object_analytics_node/src/visualizer/data/frame.hpp @@ -12,7 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__DATA__FRAME_HPP_ +#define VISUALIZER__DATA__FRAME_HPP_ + +#include #include #include @@ -28,8 +31,6 @@ #include #include -#include - #include "utility.hpp" #include "object.hpp" @@ -37,7 +38,7 @@ class sFrame { public: sFrame() {} - sFrame(cv::Mat & cv_frame); + explicit sFrame(cv::Mat & cv_frame); sFrame(cv::Mat & cv_frame, struct timespec st); virtual ~sFrame() = default; @@ -66,3 +67,4 @@ class sFrame cv::Mat frame; struct timespec stamp; }; +#endif // VISUALIZER__DATA__FRAME_HPP_ diff --git a/object_analytics_node/src/visualizer/data/frame_obj.hpp b/object_analytics_node/src/visualizer/data/frame_obj.hpp index e32330c..8ca732e 100644 --- a/object_analytics_node/src/visualizer/data/frame_obj.hpp +++ b/object_analytics_node/src/visualizer/data/frame_obj.hpp @@ -12,7 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__DATA__FRAME_OBJ_HPP_ +#define VISUALIZER__DATA__FRAME_OBJ_HPP_ + +#include #include #include @@ -28,8 +31,6 @@ #include #include -#include - #include "utility.hpp" #include "frame.hpp" @@ -61,3 +62,4 @@ class FrameObjs : public sFrame std::vector dets; std::vector tracks; }; +#endif // VISUALIZER__DATA__FRAME_OBJ_HPP_ diff --git a/object_analytics_node/src/visualizer/data/object.hpp b/object_analytics_node/src/visualizer/data/object.hpp index ee86b98..aeb8cf2 100644 --- a/object_analytics_node/src/visualizer/data/object.hpp +++ b/object_analytics_node/src/visualizer/data/object.hpp @@ -12,7 +12,10 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__DATA__OBJECT_HPP_ +#define VISUALIZER__DATA__OBJECT_HPP_ + +#include #include #include @@ -28,8 +31,6 @@ #include #include -#include - class Object { public: @@ -44,3 +45,4 @@ class Object cv::Mat Mean_; cv::Mat Covariance_; }; +#endif // VISUALIZER__DATA__OBJECT_HPP_ diff --git a/object_analytics_node/src/visualizer/device/stream_cap.cpp b/object_analytics_node/src/visualizer/device/stream_cap.cpp index 583ae23..318765d 100644 --- a/object_analytics_node/src/visualizer/device/stream_cap.cpp +++ b/object_analytics_node/src/visualizer/device/stream_cap.cpp @@ -25,7 +25,7 @@ bool stream_cap::init_stream(int stream_name) { TRACE_INFO(); - // stream_name_ = stream_name; + // stream_name_ = stream_name; cap_ = std::make_shared(stream_name); if (cap_->isOpened()) {return true;} @@ -37,7 +37,7 @@ bool stream_cap::init_stream(std::string & stream_name) { TRACE_INFO(); - // stream_name_ = stream_name; + // stream_name_ = stream_name; cap_ = std::make_shared(stream_name, cv::CAP_FFMPEG); if (cap_->isOpened()) {return true;} diff --git a/object_analytics_node/src/visualizer/device/stream_cap.hpp b/object_analytics_node/src/visualizer/device/stream_cap.hpp index e6b3be7..6c78413 100644 --- a/object_analytics_node/src/visualizer/device/stream_cap.hpp +++ b/object_analytics_node/src/visualizer/device/stream_cap.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__DEVICE__STREAM_CAP_HPP_ +#define VISUALIZER__DEVICE__STREAM_CAP_HPP_ #include @@ -55,3 +56,4 @@ class stream_cap : public stream_device protected: private: }; +#endif // VISUALIZER__DEVICE__STREAM_CAP_HPP_ diff --git a/object_analytics_node/src/visualizer/device/stream_device.hpp b/object_analytics_node/src/visualizer/device/stream_device.hpp index 9ee6126..206ff17 100644 --- a/object_analytics_node/src/visualizer/device/stream_device.hpp +++ b/object_analytics_node/src/visualizer/device/stream_device.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__DEVICE__STREAM_DEVICE_HPP_ +#define VISUALIZER__DEVICE__STREAM_DEVICE_HPP_ #include @@ -125,3 +126,4 @@ class stream_device private: bool initialized_ = false; }; +#endif // VISUALIZER__DEVICE__STREAM_DEVICE_HPP_ diff --git a/object_analytics_node/src/visualizer/device/stream_ds.cpp b/object_analytics_node/src/visualizer/device/stream_ds.cpp index ece8adf..eb698cc 100644 --- a/object_analytics_node/src/visualizer/device/stream_ds.cpp +++ b/object_analytics_node/src/visualizer/device/stream_ds.cpp @@ -15,7 +15,7 @@ #include "stream_ds.hpp" #include -#include +#include #include "frame_obj.hpp" #include "object.hpp" diff --git a/object_analytics_node/src/visualizer/device/stream_ds.hpp b/object_analytics_node/src/visualizer/device/stream_ds.hpp index 79e84c1..a21f227 100644 --- a/object_analytics_node/src/visualizer/device/stream_ds.hpp +++ b/object_analytics_node/src/visualizer/device/stream_ds.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__DEVICE__STREAM_DS_HPP_ +#define VISUALIZER__DEVICE__STREAM_DS_HPP_ #include @@ -64,3 +65,4 @@ class stream_ds : public stream_device private: }; +#endif // VISUALIZER__DEVICE__STREAM_DS_HPP_ diff --git a/object_analytics_node/src/visualizer/device/stream_render.hpp b/object_analytics_node/src/visualizer/device/stream_render.hpp index 05c52da..bf4ffa8 100644 --- a/object_analytics_node/src/visualizer/device/stream_render.hpp +++ b/object_analytics_node/src/visualizer/device/stream_render.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__DEVICE__STREAM_RENDER_HPP_ +#define VISUALIZER__DEVICE__STREAM_RENDER_HPP_ #include @@ -53,3 +54,4 @@ class stream_render private: }; +#endif // VISUALIZER__DEVICE__STREAM_RENDER_HPP_ diff --git a/object_analytics_node/src/visualizer/device/stream_vid.cpp b/object_analytics_node/src/visualizer/device/stream_vid.cpp index a328df0..4573ff5 100644 --- a/object_analytics_node/src/visualizer/device/stream_vid.cpp +++ b/object_analytics_node/src/visualizer/device/stream_vid.cpp @@ -15,7 +15,7 @@ #include "stream_vid.hpp" #include -#include +#include stream_vid::stream_vid() {TRACE_INFO();} diff --git a/object_analytics_node/src/visualizer/device/stream_vid.hpp b/object_analytics_node/src/visualizer/device/stream_vid.hpp index b5936de..cd72134 100644 --- a/object_analytics_node/src/visualizer/device/stream_vid.hpp +++ b/object_analytics_node/src/visualizer/device/stream_vid.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__DEVICE__STREAM_VID_HPP_ +#define VISUALIZER__DEVICE__STREAM_VID_HPP_ #include @@ -23,6 +24,7 @@ #include #include #include +#include #include "stream_device.hpp" @@ -60,3 +62,4 @@ class stream_vid : public stream_device protected: private: }; +#endif // VISUALIZER__DEVICE__STREAM_VID_HPP_ diff --git a/object_analytics_node/src/visualizer/model/math_model.hpp b/object_analytics_node/src/visualizer/model/math_model.hpp index e552c34..48a6fa7 100644 --- a/object_analytics_node/src/visualizer/model/math_model.hpp +++ b/object_analytics_node/src/visualizer/model/math_model.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__MODEL__MATH_MODEL_HPP_ +#define VISUALIZER__MODEL__MATH_MODEL_HPP_ #include #include @@ -45,3 +46,4 @@ class MathModel public: std::string InstName_ = ""; }; +#endif // VISUALIZER__MODEL__MATH_MODEL_HPP_ diff --git a/object_analytics_node/src/visualizer/model/math_sample.hpp b/object_analytics_node/src/visualizer/model/math_sample.hpp index c21f482..f81e419 100644 --- a/object_analytics_node/src/visualizer/model/math_sample.hpp +++ b/object_analytics_node/src/visualizer/model/math_sample.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__MODEL__MATH_SAMPLE_HPP_ +#define VISUALIZER__MODEL__MATH_SAMPLE_HPP_ #include #include @@ -85,3 +86,4 @@ class MathSample uint32_t Counts_ = 0; }; +#endif // VISUALIZER__MODEL__MATH_SAMPLE_HPP_ diff --git a/object_analytics_node/src/visualizer/model/sample/rw_sample.cpp b/object_analytics_node/src/visualizer/model/sample/rw_sample.cpp index d746f39..2663dc2 100644 --- a/object_analytics_node/src/visualizer/model/sample/rw_sample.cpp +++ b/object_analytics_node/src/visualizer/model/sample/rw_sample.cpp @@ -64,7 +64,7 @@ bool RWSample::GenSamples() res_dec = Evaluator_Proc_(seed_dec); } - double uni_rand = rng.uniform((double)0, res_inc + res_dec); + double uni_rand = rng.uniform(0.0f, res_inc + res_dec); if (uni_rand <= (res_inc)) { seed = seed_inc.clone(); res = res_inc; diff --git a/object_analytics_node/src/visualizer/model/sample/rw_sample.hpp b/object_analytics_node/src/visualizer/model/sample/rw_sample.hpp index c31fa4d..5fb4a81 100644 --- a/object_analytics_node/src/visualizer/model/sample/rw_sample.hpp +++ b/object_analytics_node/src/visualizer/model/sample/rw_sample.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__MODEL__SAMPLE__RW_SAMPLE_HPP_ +#define VISUALIZER__MODEL__SAMPLE__RW_SAMPLE_HPP_ #include #include @@ -56,3 +57,4 @@ class RWSample : public SampleModel */ virtual bool FetchSamples(cv::Mat & samples); }; +#endif // VISUALIZER__MODEL__SAMPLE__RW_SAMPLE_HPP_ diff --git a/object_analytics_node/src/visualizer/model/sample/sample_model.hpp b/object_analytics_node/src/visualizer/model/sample/sample_model.hpp index c7fa6b6..92213d0 100644 --- a/object_analytics_node/src/visualizer/model/sample/sample_model.hpp +++ b/object_analytics_node/src/visualizer/model/sample/sample_model.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__MODEL__SAMPLE__SAMPLE_MODEL_HPP_ +#define VISUALIZER__MODEL__SAMPLE__SAMPLE_MODEL_HPP_ #include #include @@ -100,3 +101,4 @@ class SampleModel */ CBPtr Evaluator_Proc_ = nullptr; }; +#endif // VISUALIZER__MODEL__SAMPLE__SAMPLE_MODEL_HPP_ diff --git a/object_analytics_node/src/visualizer/model/sample/uniform_sample.hpp b/object_analytics_node/src/visualizer/model/sample/uniform_sample.hpp index b16bb4e..b5bfa0d 100644 --- a/object_analytics_node/src/visualizer/model/sample/uniform_sample.hpp +++ b/object_analytics_node/src/visualizer/model/sample/uniform_sample.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__MODEL__SAMPLE__UNIFORM_SAMPLE_HPP_ +#define VISUALIZER__MODEL__SAMPLE__UNIFORM_SAMPLE_HPP_ #include #include @@ -60,5 +61,5 @@ class UniformSample : public SampleModel * @brief Fetch samples */ virtual bool FetchSamples(cv::Mat & samples); - }; +#endif // VISUALIZER__MODEL__SAMPLE__UNIFORM_SAMPLE_HPP_ diff --git a/object_analytics_node/src/visualizer/model/stat/gaussian_model.hpp b/object_analytics_node/src/visualizer/model/stat/gaussian_model.hpp index b47ae38..f68a960 100644 --- a/object_analytics_node/src/visualizer/model/stat/gaussian_model.hpp +++ b/object_analytics_node/src/visualizer/model/stat/gaussian_model.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__MODEL__STAT__GAUSSIAN_MODEL_HPP_ +#define VISUALIZER__MODEL__STAT__GAUSSIAN_MODEL_HPP_ #include #include @@ -52,3 +53,4 @@ class GaussianModel : public StatModel public: }; +#endif // VISUALIZER__MODEL__STAT__GAUSSIAN_MODEL_HPP_ diff --git a/object_analytics_node/src/visualizer/model/stat/stat_model.hpp b/object_analytics_node/src/visualizer/model/stat/stat_model.hpp index 02280d0..6d06d4b 100644 --- a/object_analytics_node/src/visualizer/model/stat/stat_model.hpp +++ b/object_analytics_node/src/visualizer/model/stat/stat_model.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__MODEL__STAT__STAT_MODEL_HPP_ +#define VISUALIZER__MODEL__STAT__STAT_MODEL_HPP_ #include #include @@ -70,5 +71,5 @@ class StatModel : public MathModel cv::Mat Covariance_; cv::Mat InvCovariance_; int Dimension_ = 2; - }; +#endif // VISUALIZER__MODEL__STAT__STAT_MODEL_HPP_ diff --git a/object_analytics_node/src/visualizer/render_object/render_ellipse.cpp b/object_analytics_node/src/visualizer/render_object/render_ellipse.cpp index 3e6a8b4..6f43f56 100644 --- a/object_analytics_node/src/visualizer/render_object/render_ellipse.cpp +++ b/object_analytics_node/src/visualizer/render_object/render_ellipse.cpp @@ -113,7 +113,7 @@ void RenderEllipse::DrawEllipse(cv::RotatedRect & rect, double confident_scale) double yc = rect.center.y; double a = sqrt(confident_scale) * rect.size.width / 2.0f; double b = sqrt(confident_scale) * rect.size.height / 2.0f; - double angle = M_PI * ((double)(rect.angle)) / 180.0f; + double angle = M_PI * ((static_cast(rect.angle)) / 180.0f; double t = 0, cr, sr, xi, yi; double delta = 2 * M_PI / SAMPLE_POINTS; double ca = cos(angle); diff --git a/object_analytics_node/src/visualizer/render_object/render_ellipse.hpp b/object_analytics_node/src/visualizer/render_object/render_ellipse.hpp index d3fde4d..3295a61 100644 --- a/object_analytics_node/src/visualizer/render_object/render_ellipse.hpp +++ b/object_analytics_node/src/visualizer/render_object/render_ellipse.hpp @@ -12,18 +12,22 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__RENDER_OBJECT__RENDER_ELLIPSE_HPP_ +#define VISUALIZER__RENDER_OBJECT__RENDER_ELLIPSE_HPP_ #include #include +#include +#include + #include "render_object.hpp" class RenderEllipse : public RenderObject { public: RenderEllipse(float width, float height); - RenderEllipse(cv::RotatedRect rect); + explicit RenderEllipse(cv::RotatedRect rect); RenderEllipse() {} ~RenderEllipse(); @@ -42,10 +46,10 @@ class RenderEllipse : public RenderObject virtual void DrawID(float size); - //confident_scale associate to chi-squal iso-probability ellipse - //99%-iso-probability ==> 9.21 - //95%-iso-probability ==> 5.99 - //70%-iso-probability ==> 2.41 + // confident_scale associate to chi-squal iso-probability ellipse + // 99%-iso-probability ==> 9.21 + // 95%-iso-probability ==> 5.99 + // 70%-iso-probability ==> 2.41 void DrawEllipse(cv::RotatedRect & rect, double confident_scale = 9.21); public: @@ -53,3 +57,4 @@ class RenderEllipse : public RenderObject private: }; +#endif // VISUALIZER__RENDER_OBJECT__RENDER_ELLIPSE_HPP_ diff --git a/object_analytics_node/src/visualizer/render_object/render_image.cpp b/object_analytics_node/src/visualizer/render_object/render_image.cpp index 303f16f..30728eb 100644 --- a/object_analytics_node/src/visualizer/render_object/render_image.cpp +++ b/object_analytics_node/src/visualizer/render_object/render_image.cpp @@ -13,6 +13,7 @@ // limitations under the License. #include "render_image.hpp" +#include RenderImage::RenderImage(float width, float height) : RenderObject(width, height) diff --git a/object_analytics_node/src/visualizer/render_object/render_image.hpp b/object_analytics_node/src/visualizer/render_object/render_image.hpp index 33d42cf..a00af50 100644 --- a/object_analytics_node/src/visualizer/render_object/render_image.hpp +++ b/object_analytics_node/src/visualizer/render_object/render_image.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__RENDER_OBJECT__RENDER_IMAGE_HPP_ +#define VISUALIZER__RENDER_OBJECT__RENDER_IMAGE_HPP_ #include #include @@ -46,3 +47,4 @@ class RenderImage : public RenderObject private: }; +#endif // VISUALIZER__RENDER_OBJECT__RENDER_IMAGE_HPP_ diff --git a/object_analytics_node/src/visualizer/render_object/render_lines.cpp b/object_analytics_node/src/visualizer/render_object/render_lines.cpp index 8dcd320..684d945 100644 --- a/object_analytics_node/src/visualizer/render_object/render_lines.cpp +++ b/object_analytics_node/src/visualizer/render_object/render_lines.cpp @@ -68,7 +68,7 @@ void RenderLines::DrawObject() // Turn Blending On glEnable(GL_BLEND); // Turn Depth Testing Off - // glDisable(GL_DEPTH_TEST); + // glDisable(GL_DEPTH_TEST); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // Turn Depth Testing Off diff --git a/object_analytics_node/src/visualizer/render_object/render_lines.hpp b/object_analytics_node/src/visualizer/render_object/render_lines.hpp index 21cc536..979e42d 100644 --- a/object_analytics_node/src/visualizer/render_object/render_lines.hpp +++ b/object_analytics_node/src/visualizer/render_object/render_lines.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__RENDER_OBJECT__RENDER_LINES_HPP_ +#define VISUALIZER__RENDER_OBJECT__RENDER_LINES_HPP_ #include #include @@ -45,3 +46,4 @@ class RenderLines : public RenderObject private: }; +#endif // VISUALIZER__RENDER_OBJECT__RENDER_LINES_HPP_ diff --git a/object_analytics_node/src/visualizer/render_object/render_object.cpp b/object_analytics_node/src/visualizer/render_object/render_object.cpp index 5606659..a6176d1 100644 --- a/object_analytics_node/src/visualizer/render_object/render_object.cpp +++ b/object_analytics_node/src/visualizer/render_object/render_object.cpp @@ -14,6 +14,9 @@ #include "render_object.hpp" +#include +#include + RenderObject::RenderObject() { TRACE_INFO(); @@ -54,10 +57,9 @@ void RenderObject::SetID(std::string id) bool inv = (i_dec % 2); - ObjColor_[0] = float(i_dec % 9) / (9.0f); - - ObjColor_[1] = float(i_dec % 5) / (5.0f); - ObjColor_[2] = float(i_dec % 7) / (7.0f); + ObjColor_[0] = static_cast(i_dec % 9) / (9.0f); + ObjColor_[1] = static_cast(i_dec % 5) / (5.0f); + ObjColor_[2] = static_cast(i_dec % 7) / (7.0f); } std::string RenderObject::GetID() {return Id_;} @@ -172,14 +174,14 @@ void RenderObject::DrawGrid(float step) glDisable(GL_LINE_STIPPLE); for (float i = 0; i <= Height_; i += step) { - std::string str = std::to_string((int)i); + std::string str = std::to_string(static_cast(i)); pangolin::GlText txt = pangolin::GlFont::I().Text(str.c_str()); txt.Draw(0, i, 0); txt.Draw(Width_, i, 0); } for (float i = 0; i <= Width_; i += step) { - std::string str = std::to_string((int)i); + std::string str = std::to_string(static_cast(i)); pangolin::GlText txt = pangolin::GlFont::I().Text(str.c_str()); txt.Draw(i, 0, 0); // lines parallel to Z-axis txt.Draw(i, Height_, 0); diff --git a/object_analytics_node/src/visualizer/render_object/render_object.hpp b/object_analytics_node/src/visualizer/render_object/render_object.hpp index 0c25b7f..074b238 100644 --- a/object_analytics_node/src/visualizer/render_object/render_object.hpp +++ b/object_analytics_node/src/visualizer/render_object/render_object.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__RENDER_OBJECT__RENDER_OBJECT_HPP_ +#define VISUALIZER__RENDER_OBJECT__RENDER_OBJECT_HPP_ #include #include @@ -35,7 +36,6 @@ class RenderObject { - #define TRACE_INFO() public: @@ -57,9 +57,8 @@ class RenderObject virtual void Render(); virtual void Finish(); - //To be implement!!!! - //SetColorForeground and SetColorBackground - + // To be implement!!!! + // SetColorForeground and SetColorBackground virtual void DrawAxis(float size); virtual void DrawID(float size); @@ -96,6 +95,5 @@ class RenderObject float ObjColor_[3] = {0.3f, 0.3f, 0.3f}; std::vector SubObjs_; - -private: }; +#endif // VISUALIZER__RENDER_OBJECT__RENDER_OBJECT_HPP_ diff --git a/object_analytics_node/src/visualizer/render_object/render_rect.hpp b/object_analytics_node/src/visualizer/render_object/render_rect.hpp index bb75b8e..d69059f 100644 --- a/object_analytics_node/src/visualizer/render_object/render_rect.hpp +++ b/object_analytics_node/src/visualizer/render_object/render_rect.hpp @@ -12,18 +12,22 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__RENDER_OBJECT__RENDER_RECT_HPP_ +#define VISUALIZER__RENDER_OBJECT__RENDER_RECT_HPP_ #include #include +#include +#include + #include "render_object.hpp" class RenderRect : public RenderObject { public: RenderRect(float width, float height); - RenderRect(cv::Rect rect); + explicit RenderRect(cv::Rect rect); RenderRect() {} ~RenderRect(); @@ -47,3 +51,4 @@ class RenderRect : public RenderObject private: }; +#endif // VISUALIZER__RENDER_OBJECT__RENDER_RECT_HPP_ diff --git a/object_analytics_node/src/visualizer/utils/utility.hpp b/object_analytics_node/src/visualizer/utils/utility.hpp index 0d6fdf8..e858e38 100644 --- a/object_analytics_node/src/visualizer/utils/utility.hpp +++ b/object_analytics_node/src/visualizer/utils/utility.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__UTILS__UTILITY_HPP_ +#define VISUALIZER__UTILS__UTILITY_HPP_ #define __FILENAME__ \ (strrchr(__FILE__, '/') ? (strrchr(__FILE__, '/') + 1) : __FILE__) @@ -28,3 +29,4 @@ #define TRACE_ERR(fmt, args ...) \ printf("[ERR ]: %s(%d)<%s>\t" fmt "\n", __FILENAME__, __LINE__, \ __FUNCTION__, ## args) +#endif // VISUALIZER__UTILS__UTILITY_HPP_ diff --git a/object_analytics_node/src/visualizer/view/view.cpp b/object_analytics_node/src/visualizer/view/view.cpp index ae934bf..e146609 100644 --- a/object_analytics_node/src/visualizer/view/view.cpp +++ b/object_analytics_node/src/visualizer/view/view.cpp @@ -13,6 +13,7 @@ // limitations under the License. #include "view.hpp" +#include View::View() { diff --git a/object_analytics_node/src/visualizer/view/view.hpp b/object_analytics_node/src/visualizer/view/view.hpp index 23ce559..1205eaf 100644 --- a/object_analytics_node/src/visualizer/view/view.hpp +++ b/object_analytics_node/src/visualizer/view/view.hpp @@ -12,7 +12,8 @@ // See the License for the specific language governing permissions and // limitations under the License. -#pragma once +#ifndef VISUALIZER__VIEW__VIEW_HPP_ +#define VISUALIZER__VIEW__VIEW_HPP_ #include #include @@ -25,6 +26,9 @@ #include #include +#include +#include + #include "render_object.hpp" #include "utility.hpp" @@ -89,3 +93,4 @@ class View Layout Layout_; }; +#endif // VISUALIZER__VIEW__VIEW_HPP_ diff --git a/object_analytics_rviz/src/image_publisher.cpp b/object_analytics_rviz/src/image_publisher.cpp index cd5f3a4..8589f00 100644 --- a/object_analytics_rviz/src/image_publisher.cpp +++ b/object_analytics_rviz/src/image_publisher.cpp @@ -112,7 +112,7 @@ class ImagePublisher : public rclcpp::Node findObject(cv_ptr, objects_tracked); - image_pub_->publish(cv_ptr->toImageMsg()); + image_pub_->publish(*(cv_ptr->toImageMsg())); } }