Skip to content

Commit 7430c85

Browse files
committed
Two changes for catkin_make to compile under gta-robotics docker:
(error: 'vector' does not name a type) vector compression_params; to: std::vector compression_params; and needed to add: (error: 'imshow' is not a member of 'cv') include <opencv2/highgui/highgui.hpp>
1 parent 66d9039 commit 7430c85

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

‎src/lidar/src/lidar_node.cpp‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <vector>
66
#include <float.h>
77
#include <stdio.h>
8-
#include <math.h>
8+
#include <math.h>
99
#include <sstream>
1010

1111
#include <pcl_conversions/pcl_conversions.h>
@@ -19,6 +19,7 @@
1919
#include <cv_bridge/cv_bridge.h>
2020
#include <opencv/cv.h>
2121
#include <opencv/highgui.h>
22+
#include <opencv2/highgui/highgui.hpp>
2223

2324
#include <ros/ros.h>
2425
#include <ros/console.h>
@@ -41,7 +42,7 @@ sensor_msgs::PointCloud2 output;
4142
double heightArray[IMAGE_HEIGHT][IMAGE_WIDTH];
4243

4344
cv::Mat *heightmap;
44-
vector<int> compression_params;
45+
std::vector<int> compression_params;
4546

4647
int fnameCounter;
4748
double lowest;
@@ -89,8 +90,8 @@ void DEM(const sensor_msgs::PointCloud2ConstPtr& pointCloudMsg)
8990

9091
// clear cloud and height map array
9192
lowest = FLT_MAX;
92-
for(int i = 0; i < IMAGE_HEIGHT; ++i){
93-
for(int j = 0; j < IMAGE_WIDTH; ++j){
93+
for(int i = 0; i < IMAGE_HEIGHT; ++i){
94+
for(int j = 0; j < IMAGE_WIDTH; ++j){
9495
heightArray[i][j] = (double)(-FLT_MAX);
9596
}
9697
}
@@ -116,8 +117,8 @@ void DEM(const sensor_msgs::PointCloud2ConstPtr& pointCloudMsg)
116117
// Create "point cloud" and opencv image to be published for visualization
117118
int index = 0;
118119
double x, y;
119-
for(int i = 0; i < IMAGE_HEIGHT; ++i){
120-
for(int j = 0; j < IMAGE_WIDTH; ++j){
120+
for(int i = 0; i < IMAGE_HEIGHT; ++i){
121+
for(int j = 0; j < IMAGE_WIDTH; ++j){
121122
// Add point to cloud
122123
(void)map_rc2pc(&x, &y, i, j);
123124
cloud_grid->points[index].x = x;
@@ -179,7 +180,7 @@ int main(int argc, char** argv)
179180
lowest = FLT_MAX;
180181
compression_params.push_back(CV_IMWRITE_PNG_COMPRESSION);
181182
compression_params.push_back(9);
182-
183+
183184
// Setup indicies in point clouds
184185
/*
185186
int index = 0;

0 commit comments

Comments
 (0)